using System.Threading.Tasks; using DeukBot4.MessageHandlers.CommandHandler.RequestStructure; using DeukBot4.MessageHandlers.Permissions; namespace DeukBot4.MessageHandlers.CommandHandler { public class GeneralCommands : CommandContainerBase { public override string Name => "General"; [Command("ping", PermissionLevel.Everyone)] [CommandHelp("Simple Ping Pong Response", "Generates a simple Pong response when triggered")] public async Task Ping(CommandRequest request) { await request.OriginalMessage.Channel.SendMessageAsync("Pong"); } [Command("help", PermissionLevel.Everyone)] [CommandParameters(new []{ParameterMatcher.ParameterType.Word})] [CommandHelp("Displays a list of commands for the bot", @"Allows you to see all commands you can use for your permission level, along with a description. usage: ``help`` for a list of all commands useable for you. ``help`` [command name] for more detailed info on a specific command. Note that you need to be able to use the command to get this info." )] public async Task Help(CommandRequest request) { if (request.Parameters.Length == 0) { await request.OriginalMessage.Channel.SendMessageAsync( HelpCommandGenerator.GenerateFullHelp(request.RequestPermissions)); } else { await request.OriginalMessage.Channel.SendMessageAsync( HelpCommandGenerator.GenerateSpecificHelp(request.Parameters[0].AsString(), request.RequestPermissions)); } } } }