if .iam is successfull it will delete command and confirmation after 3 seconds

This commit is contained in:
Master Kwoth 2016-05-25 02:37:54 +02:00
parent 398f032497
commit f3067b60f9
2 changed files with 9 additions and 2 deletions

View File

@ -995,7 +995,6 @@ namespace NadekoBot.Modules.Administration
await e.Channel.SendMessage("Nobody. (not 100% sure)"); await e.Channel.SendMessage("Nobody. (not 100% sure)");
else else
await e.Channel.SendMessage("• " + string.Join("\n• ", arr)); await e.Channel.SendMessage("• " + string.Join("\n• ", arr));
}); });
}); });

View File

@ -4,6 +4,7 @@ using NadekoBot.Modules.Permissions.Classes;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace NadekoBot.Modules.Administration.Commands namespace NadekoBot.Modules.Administration.Commands
{ {
@ -121,7 +122,14 @@ namespace NadekoBot.Modules.Administration.Commands
return; return;
} }
await e.User.AddRoles(role).ConfigureAwait(false); 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") cgb.CreateCommand(".iamn")