This commit is contained in:
@@ -3,6 +3,7 @@ using Discord.WebSocket;
|
||||
|
||||
using PluginManager.Loaders;
|
||||
using PluginManager.Interfaces;
|
||||
using PluginManager.Others.Permissions;
|
||||
|
||||
namespace PluginManager.Commands
|
||||
{
|
||||
@@ -17,21 +18,47 @@ namespace PluginManager.Commands
|
||||
public bool canUseDM => true;
|
||||
public bool canUseServer => true;
|
||||
|
||||
public bool requireAdmin => false;
|
||||
|
||||
public void Execute(SocketCommandContext context, SocketMessage message, DiscordSocketClient client, bool isDM)
|
||||
{
|
||||
if (isDM)
|
||||
bool isAdmin = ((SocketGuildUser)message.Author).isAdmin();
|
||||
if (isAdmin)
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseDM)
|
||||
context.Channel.SendMessageAsync(p.Usage + "\t" + p.Description);
|
||||
if (isDM)
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseDM)
|
||||
if (p.requireAdmin)
|
||||
context.Channel.SendMessageAsync("[ADMIN] " + p.Usage + "\t" + p.Description);
|
||||
else context.Channel.SendMessageAsync(p.Usage + "\t" + p.Description);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseServer)
|
||||
if (p.requireAdmin)
|
||||
context.Channel.SendMessageAsync("[ADMIN] " + p.Usage + "\t" + p.Description);
|
||||
else 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);
|
||||
if (isDM)
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseDM && !p.requireAdmin)
|
||||
context.Channel.SendMessageAsync(p.Usage + "\t" + p.Description);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (DBCommand p in PluginLoader.Plugins!)
|
||||
if (p.canUseServer && !p.requireAdmin)
|
||||
context.Channel.SendMessageAsync(p.Usage + "\t" + p.Description);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user