using System; using System.Threading.Tasks; using DeukBot4.MessageHandlers.CommandHandler.RequestStructure; using DeukBot4.MessageHandlers.Permissions; using DeukBot4.Utilities; using Discord; namespace DeukBot4.MessageHandlers.CommandHandler { public class GeneralCommands : CommandContainerBase { public override string Name => "General"; [Command("info", PermissionLevel.Everyone)] [CommandHelp("Gives basic info on the bot", "Gives basic info on the bot")] public async Task Info(CommandRequest request) { var embed = new EmbedBuilder { Author = new EmbedAuthorBuilder() { Name = "DeukBot", Url = "https://gitlab.com/Deukhoofd/DeukBot4/tree/master/DeukBot4/MessageHandlers/CommandHandler" }, Color = Color.Gold, Title = "Deukbot Info", Description = "A bot designed by Deukhoofd for use on the Epsilon server", Timestamp = DateTime.UtcNow }; embed.AddField("Software", "Deukbot 4.0", true); embed.AddField("Creator", "Deukhoofd#7361", true); await request.SendMessageAsync("", embed: embed.Build()); } [Command("ping", PermissionLevel.Everyone)] [CommandHelp("Simple Ping Pong Response", "Generates a simple Pong response when triggered")] public async Task Ping(CommandRequest request) { await request.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.\n" + "usage:\n``help`` for a list of all commands useable for you.\n" + "``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.SendMessageAsync(HelpCommandGenerator.GenerateFullHelp(request.RequestPermissions)); } else { await request.SendMessageAsync("", embed: HelpCommandGenerator.GenerateSpecificHelp(request.Parameters[0].AsString(), request.RequestPermissions)); } } [Command("whatdoyouthinkdeukbot", PermissionLevel.Everyone)] [Command("whatdoyouthink", PermissionLevel.Everyone)] [CommandHelp("Gives the bots opinion about something", "Gives the bots opinion about something\nusage:\n``whatdoyouthink {about something}``")] [CommandParameters(ParameterMatcher.ParameterType.Remainder)] public async Task BotOpinion(CommandRequest request) { await request.SendMessageAsync(BotOpinions.GetOpinion(request)); } } }