diff --git a/DisCatSharp/EventArgs/Message/MessageCreateEventArgs.cs b/DisCatSharp/EventArgs/Message/MessageCreateEventArgs.cs
index b92d8532a..3f2ff2793 100644
--- a/DisCatSharp/EventArgs/Message/MessageCreateEventArgs.cs
+++ b/DisCatSharp/EventArgs/Message/MessageCreateEventArgs.cs
@@ -1,86 +1,83 @@
// This file is part of the DisCatSharp project, based off DSharpPlus.
//
// Copyright (c) 2021-2022 AITSYS
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
using System.Collections.Generic;
using DisCatSharp.Entities;
namespace DisCatSharp.EventArgs;
///
/// Represents arguments for event.
///
public class MessageCreateEventArgs : DiscordEventArgs
{
///
/// Gets the message that was created.
///
public DiscordMessage Message { get; internal set; }
///
/// Gets the channel this message belongs to.
///
public DiscordChannel Channel
=> this.Message.Channel;
///
/// Gets the guild this message belongs to.
///
public DiscordGuild Guild
=> this.Channel.Guild;
///
/// Gets the guild id in case it couldn't convert.
///
public ulong? GuildId
=> this.Message.GuildId;
///
/// Gets the author of the message.
///
public DiscordUser Author
=> this.Message.Author;
///
/// Gets the collection of mentioned users.
///
public IReadOnlyList MentionedUsers { get; internal set; }
///
/// Gets the collection of mentioned roles.
///
public IReadOnlyList MentionedRoles { get; internal set; }
///
/// Gets the collection of mentioned channels.
///
public IReadOnlyList MentionedChannels { get; internal set; }
///
/// Initializes a new instance of the class.
///
- internal MessageCreateEventArgs(IServiceProvider provider) : base(provider)
- {
- this.Message.Channel.GuildId = this.Message.GuildId;
- }
+ internal MessageCreateEventArgs(IServiceProvider provider) : base(provider) { }
}
diff --git a/DisCatSharp/EventArgs/Message/MessageUpdateEventArgs.cs b/DisCatSharp/EventArgs/Message/MessageUpdateEventArgs.cs
index 298e4c5a0..339397d25 100644
--- a/DisCatSharp/EventArgs/Message/MessageUpdateEventArgs.cs
+++ b/DisCatSharp/EventArgs/Message/MessageUpdateEventArgs.cs
@@ -1,91 +1,88 @@
// This file is part of the DisCatSharp project, based off DSharpPlus.
//
// Copyright (c) 2021-2022 AITSYS
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
using System.Collections.Generic;
using DisCatSharp.Entities;
namespace DisCatSharp.EventArgs;
///
/// Represents arguments for event.
///
public class MessageUpdateEventArgs : DiscordEventArgs
{
///
/// Gets the message that was updated.
///
public DiscordMessage Message { get; internal set; }
///
/// Gets the message before it got updated. This property will be null if the message was not cached.
///
public DiscordMessage MessageBefore { get; internal set; }
///
/// Gets the channel this message belongs to.
///
public DiscordChannel Channel
=> this.Message.Channel;
///
/// Gets the guild this message belongs to.
///
public DiscordGuild Guild
=> this.Channel.Guild;
///
/// Gets the guild id in case it couldn't convert.
///
public ulong? GuildId
=> this.Message.GuildId;
///
/// Gets the author of the message.
///
public DiscordUser Author
=> this.Message.Author;
///
/// Gets the collection of mentioned users.
///
public IReadOnlyList MentionedUsers { get; internal set; }
///
/// Gets the collection of mentioned roles.
///
public IReadOnlyList MentionedRoles { get; internal set; }
///
/// Gets the collection of mentioned channels.
///
public IReadOnlyList MentionedChannels { get; internal set; }
///
/// Initializes a new instance of the class.
///
- internal MessageUpdateEventArgs(IServiceProvider provider) : base(provider)
- {
- this.Message.Channel.GuildId = this.Message.GuildId;
- }
+ internal MessageUpdateEventArgs(IServiceProvider provider) : base(provider) { }
}