-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor, pull requests, and other changes
- Refactor namespaces, etc - Move a few classes - Rename MyCommandContext to BotCommandContext - Add new precondition: RequireTrustedMemberAttribute - Add classes, methods, etc related to github pull requests
- Loading branch information
Showing
29 changed files
with
320 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 31 additions & 28 deletions
59
...ordNet/Modules/Addons/MyCommandContext.cs → ...rdNet/Modules/Addons/BotCommandContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
using Discord; | ||
using Discord.Commands; | ||
using DiscordNet.Controllers; | ||
|
||
namespace DiscordNet.Modules.Addons | ||
{ | ||
public class MyCommandContext : ICommandContext | ||
{ | ||
public IDiscordClient Client { get; } | ||
public IGuild Guild { get; } | ||
public MainController MainController { get; } | ||
public IMessageChannel Channel { get; } | ||
public IUser User { get; } | ||
public IUserMessage Message { get; } | ||
|
||
public bool IsPrivate => Channel is IPrivateChannel; | ||
|
||
public MyCommandContext(IDiscordClient client, MainController controller, IUserMessage msg) | ||
{ | ||
Client = client; | ||
Guild = (msg.Channel as IGuildChannel)?.Guild; | ||
Channel = msg.Channel; | ||
User = msg.Author; | ||
Message = msg; | ||
MainController = controller; | ||
} | ||
} | ||
} | ||
using Discord; | ||
using Discord.Commands; | ||
using Discord.WebSocket; | ||
|
||
namespace DiscordNet | ||
{ | ||
public class BotCommandContext : ICommandContext | ||
{ | ||
public DiscordSocketClient Client { get; } | ||
public SocketGuild Guild { get; } | ||
public MainController MainController { get; } | ||
public IMessageChannel Channel { get; } | ||
public IUser User { get; } | ||
public IUserMessage Message { get; } | ||
|
||
public bool IsPrivate => Channel is IPrivateChannel; | ||
|
||
public BotCommandContext(DiscordSocketClient client, MainController controller, IUserMessage msg) | ||
{ | ||
Client = client; | ||
Guild = (msg.Channel as SocketGuildChannel)?.Guild; | ||
Channel = msg.Channel; | ||
User = msg.Author; | ||
Message = msg; | ||
MainController = controller; | ||
} | ||
|
||
IDiscordClient ICommandContext.Client => Client; | ||
IGuild ICommandContext.Guild => Guild; | ||
} | ||
} |
Oops, something went wrong.