From f3067b60f95349396c3b15a8048497f722553391 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Wed, 25 May 2016 02:37:54 +0200 Subject: [PATCH] if .iam is successfull it will delete command and confirmation after 3 seconds --- .../Modules/Administration/AdministrationModule.cs | 1 - .../Commands/SelfAssignedRolesCommand.cs | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index f1ddd827..5c69485f 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -995,7 +995,6 @@ namespace NadekoBot.Modules.Administration await e.Channel.SendMessage("Nobody. (not 100% sure)"); else await e.Channel.SendMessage("• " + string.Join("\n• ", arr)); - }); }); diff --git a/NadekoBot/Modules/Administration/Commands/SelfAssignedRolesCommand.cs b/NadekoBot/Modules/Administration/Commands/SelfAssignedRolesCommand.cs index f61dc35d..e91ca46a 100644 --- a/NadekoBot/Modules/Administration/Commands/SelfAssignedRolesCommand.cs +++ b/NadekoBot/Modules/Administration/Commands/SelfAssignedRolesCommand.cs @@ -4,6 +4,7 @@ using NadekoBot.Modules.Permissions.Classes; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading.Tasks; namespace NadekoBot.Modules.Administration.Commands { @@ -121,7 +122,14 @@ namespace NadekoBot.Modules.Administration.Commands return; } await e.User.AddRoles(role).ConfigureAwait(false); - await e.Channel.SendMessage($":ok:You now have {role.Name} role.").ConfigureAwait(false); + var msg = await e.Channel.SendMessage($":ok:You now have {role.Name} role.").ConfigureAwait(false); + await Task.Delay(3000); + await msg.Delete(); + try + { + await e.Message.Delete(); + } + catch { } }); cgb.CreateCommand(".iamn")