You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using Discord.WebSocket;
-
- namespace Discord.Commands
- {
- public class SocketCommandContext : ICommandContext
- {
- public DiscordSocketClient Client { get; }
- public SocketGuild Guild { get; }
- public ISocketMessageChannel Channel { get; }
- public SocketUser User { get; }
- public SocketUserMessage Message { get; }
-
- public bool IsPrivate => Channel is IPrivateChannel;
-
- public SocketCommandContext(DiscordSocketClient client, SocketUserMessage msg)
- {
- Client = client;
- Guild = (msg.Channel as SocketGuildChannel)?.Guild;
- Channel = msg.Channel;
- User = msg.Author;
- Message = msg;
- }
-
- //ICommandContext
- IDiscordClient ICommandContext.Client => Client;
- IGuild ICommandContext.Guild => Guild;
- IMessageChannel ICommandContext.Channel => Channel;
- IUser ICommandContext.User => User;
- IUserMessage ICommandContext.Message => Message;
- }
- }
|