QoL changes

This commit is contained in:
Kwoth 2016-12-08 17:30:29 +01:00
parent 5324cc2229
commit 9c989804e8
3 changed files with 6 additions and 6 deletions

View File

@ -40,11 +40,11 @@ namespace NadekoBot.Modules.Administration
}
}
private async void DelMsgOnCmd_Handler(object sender, CommandExecutedEventArgs e)
private async Task DelMsgOnCmd_Handler(IUserMessage msg, Command cmd)
{
try
{
var channel = e.Message.Channel as ITextChannel;
var channel = msg.Channel as ITextChannel;
if (channel == null)
return;
@ -56,7 +56,7 @@ namespace NadekoBot.Modules.Administration
}
if (shouldDelete)
await e.Message.DeleteAsync().ConfigureAwait(false);
await msg.DeleteAsync().ConfigureAwait(false);
}
catch (Exception ex)
{

View File

@ -39,7 +39,7 @@ namespace NadekoBot.Services
private List<IDMChannel> ownerChannels { get; set; }
public event EventHandler<CommandExecutedEventArgs> CommandExecuted = delegate { };
public event Func<IUserMessage,Command, Task> CommandExecuted = delegate { return Task.CompletedTask; };
public CommandHandler(ShardedDiscordClient client, CommandService commandService)
{
@ -154,7 +154,7 @@ namespace NadekoBot.Services
var channel = (usrMsg.Channel as ITextChannel);
if (result.IsSuccess)
{
CommandExecuted(this, new CommandExecutedEventArgs(usrMsg, command));
await CommandExecuted(usrMsg, command);
_log.Info("Command Executed after {4}s\n\t" +
"User: {0}\n\t" +
"Server: {1}\n\t" +

View File

@ -38,7 +38,7 @@ namespace NadekoBot.Services.Impl
Reset();
this.client.MessageReceived += _ => Task.FromResult(MessageCounter++);
cmdHandler.CommandExecuted += (_, e) => CommandsRan++;
cmdHandler.CommandExecuted += (_, e) => Task.FromResult(CommandsRan++);
this.client.Disconnected += _ => Reset();