Some random changes to commandhandler
This commit is contained in:
parent
14b797cfb6
commit
3fa6e6b162
@ -215,19 +215,19 @@ namespace NadekoBot.Services
|
|||||||
if (IsBlacklisted(guild, usrMsg))
|
if (IsBlacklisted(guild, usrMsg))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var cleverBotRan = await TryRunCleverbot(usrMsg, guild).ConfigureAwait(false);
|
var cleverBotRan = await Task.Run(() => TryRunCleverbot(usrMsg, guild)).ConfigureAwait(false);
|
||||||
if (cleverBotRan)
|
if (cleverBotRan)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// maybe this message is a custom reaction
|
// maybe this message is a custom reaction
|
||||||
var crExecuted = await CustomReactions.TryExecuteCustomReaction(usrMsg).ConfigureAwait(false);
|
var crExecuted = await Task.Run(() => CustomReactions.TryExecuteCustomReaction(usrMsg)).ConfigureAwait(false);
|
||||||
if (crExecuted) //if it was, don't execute the command
|
if (crExecuted) //if it was, don't execute the command
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string messageContent = usrMsg.Content;
|
string messageContent = usrMsg.Content;
|
||||||
|
|
||||||
// execute the command and measure the time it took
|
// execute the command and measure the time it took
|
||||||
var exec = await ExecuteCommand(new CommandContext(_client, usrMsg), messageContent, DependencyMap.Empty, MultiMatchHandling.Best);
|
var exec = await Task.Run(() => ExecuteCommand(new CommandContext(_client, usrMsg), messageContent, DependencyMap.Empty, MultiMatchHandling.Best)).ConfigureAwait(false);
|
||||||
execTime = Environment.TickCount - execTime;
|
execTime = Environment.TickCount - execTime;
|
||||||
|
|
||||||
if (exec.Result.IsSuccess)
|
if (exec.Result.IsSuccess)
|
||||||
|
Loading…
Reference in New Issue
Block a user