The bot is async again
This commit is contained in:
parent
871b59adae
commit
916181a878
1 changed files with 1 additions and 6 deletions
|
@ -101,12 +101,7 @@ namespace Geekbot.net
|
||||||
}
|
}
|
||||||
if (!(message.HasCharPrefix('!', ref argPos) || message.HasMentionPrefix(client.CurrentUser, ref argPos))) return;
|
if (!(message.HasCharPrefix('!', ref argPos) || message.HasMentionPrefix(client.CurrentUser, ref argPos))) return;
|
||||||
var context = new CommandContext(client, message);
|
var context = new CommandContext(client, message);
|
||||||
//commands.ExecuteAsync(context, argPos, map);
|
Task.Run(() => commands.ExecuteAsync(context, argPos, map));
|
||||||
var result = await Task.Run(() => commands.ExecuteAsync(context, argPos, map));
|
|
||||||
if (!result.IsSuccess)
|
|
||||||
{
|
|
||||||
await context.Channel.SendMessageAsync(result.ErrorReason);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task HandleMessageReceived(SocketMessage messsageParam)
|
public async Task HandleMessageReceived(SocketMessage messsageParam)
|
||||||
|
|
Loading…
Reference in a new issue