Add project files.
This commit is contained in:
37
DiscordBot/Discord/Commands/Help.cs
Normal file
37
DiscordBot/Discord/Commands/Help.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Discord.Commands;
|
||||
using Discord.WebSocket;
|
||||
|
||||
using PluginManager.Loaders;
|
||||
using PluginManager.Interfaces;
|
||||
|
||||
namespace PluginManager.Commands
|
||||
{
|
||||
internal class Help : DBCommand
|
||||
{
|
||||
public string Command => "help";
|
||||
|
||||
public string Description => "This command allows you to check all loadded commands";
|
||||
|
||||
public string Usage => "help";
|
||||
|
||||
public bool canUseDM => true;
|
||||
public bool canUseServer => true;
|
||||
|
||||
public void Execute(SocketCommandContext context, SocketMessage message, DiscordSocketClient client, bool isDM)
|
||||
{
|
||||
if (isDM)
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseDM)
|
||||
context.Channel.SendMessageAsync(p.Usage + "\t" + p.Description);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseServer)
|
||||
context.Channel.SendMessageAsync(p.Usage + "\t" + p.Description);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user