Getting opinion doesn't need to be async

This commit is contained in:
Deukhoofd 2018-03-30 18:33:05 +02:00
parent 4407214a8e
commit 4e09fc1de0
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
2 changed files with 6 additions and 7 deletions

View File

@ -42,11 +42,10 @@ namespace DeukBot4.MessageHandlers.CommandHandler
[Command("help", PermissionLevel.Everyone)] [Command("help", PermissionLevel.Everyone)]
[CommandParameters(new []{ParameterMatcher.ParameterType.Word})] [CommandParameters(new []{ParameterMatcher.ParameterType.Word})]
[CommandHelp("Displays a list of commands for the bot", [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. "Allows you to see all commands you can use for your permission level, along with a description.\n" +
usage: "usage:\n``help`` for a list of all commands useable for you.\n" +
``help`` for a list of all commands useable for you. "``help`` [command name] for more detailed info on a specific command. " +
``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." "Note that you need to be able to use the command to get this info.")]
)]
public async Task Help(CommandRequest request) public async Task Help(CommandRequest request)
{ {
if (request.Parameters.Length == 0) if (request.Parameters.Length == 0)
@ -66,7 +65,7 @@ usage:
[CommandParameters(ParameterMatcher.ParameterType.Remainder)] [CommandParameters(ParameterMatcher.ParameterType.Remainder)]
public async Task BotOpinion(CommandRequest request) public async Task BotOpinion(CommandRequest request)
{ {
await request.SendMessageAsync(await BotOpinions.GetOpinion(request)); await request.SendMessageAsync(BotOpinions.GetOpinion(request));
} }
} }
} }

View File

@ -6,7 +6,7 @@ namespace DeukBot4.Utilities
{ {
public static class BotOpinions public static class BotOpinions
{ {
public static async Task<string> GetOpinion(CommandRequest request) public static string GetOpinion(CommandRequest request)
{ {
var extend = request.Parameters[0].AsString().ToLowerInvariant(); var extend = request.Parameters[0].AsString().ToLowerInvariant();
if (string.IsNullOrWhiteSpace(extend)) if (string.IsNullOrWhiteSpace(extend))