>pick has no cooldown on self-hosted bots

This commit is contained in:
Kwoth 2017-01-05 11:21:38 +01:00
parent d9e6bc4676
commit 58ff017bf8

View File

@ -111,9 +111,12 @@ namespace NadekoBot.Modules.Games
{ {
var channel = (ITextChannel)Context.Channel; var channel = (ITextChannel)Context.Channel;
if (!(await channel.Guild.GetCurrentUserAsync()).GetPermissions(channel).ManageMessages || !usersRecentlyPicked.Add(Context.User.Id)) if (!(await channel.Guild.GetCurrentUserAsync()).GetPermissions(channel).ManageMessages)
return; return;
#if GLOBAL_NADEKO
if (!usersRecentlyPicked.Add(Context.User.Id))
return;
#endif
try try
{ {
@ -131,8 +134,10 @@ namespace NadekoBot.Modules.Games
} }
finally finally
{ {
#if GLOBAL_NADEKO
await Task.Delay(60000); await Task.Delay(60000);
usersRecentlyPicked.TryRemove(Context.User.Id); usersRecentlyPicked.TryRemove(Context.User.Id);
#endif
} }
} }