some random formatting

This commit is contained in:
Kwoth 2016-08-02 02:03:46 +02:00
parent 7399f798bc
commit e7f06c38b4

View File

@ -49,7 +49,6 @@ namespace NadekoBot.Modules.Permissions.Classes
{ {
return false; return false;
} }
if (timeBlackList.Contains(user.Id)) if (timeBlackList.Contains(user.Id))
return false; return false;
@ -64,9 +63,9 @@ namespace NadekoBot.Modules.Permissions.Classes
PermissionsHandler.PermissionsDict.TryGetValue(user.Server.Id, out perms); PermissionsHandler.PermissionsDict.TryGetValue(user.Server.Id, out perms);
AddUserCooldown(user.Server.Id, user.Id, command.Text.ToLower()); AddUserCooldown(user.Server.Id, user.Id, command.Text.ToLower());
if (commandCooldowns.Keys.Contains(user.Server.Id+":"+command.Text.ToLower())) if (commandCooldowns.Keys.Contains(user.Server.Id + ":" + command.Text.ToLower()))
{ {
if(perms?.Verbose == true) if (perms?.Verbose == true)
error = $"{user.Mention} You have a cooldown on that command."; error = $"{user.Mention} You have a cooldown on that command.";
return false; return false;
} }
@ -150,7 +149,8 @@ namespace NadekoBot.Modules.Permissions.Classes
} }
} }
public void AddUserCooldown(ulong serverId, ulong userId, string commandName) { public void AddUserCooldown(ulong serverId, ulong userId, string commandName)
{
commandCooldowns.TryAdd(commandName, userId); commandCooldowns.TryAdd(commandName, userId);
var tosave = serverId + ":" + commandName; var tosave = serverId + ":" + commandName;
Task.Run(async () => Task.Run(async () =>
@ -158,7 +158,8 @@ namespace NadekoBot.Modules.Permissions.Classes
ServerPermissions perms; ServerPermissions perms;
PermissionsHandler.PermissionsDict.TryGetValue(serverId, out perms); PermissionsHandler.PermissionsDict.TryGetValue(serverId, out perms);
int cd; int cd;
if (!perms.CommandCooldowns.TryGetValue(commandName,out cd)) { if (!perms.CommandCooldowns.TryGetValue(commandName, out cd))
{
return; return;
} }
if (commandCooldowns.TryAdd(tosave, userId)) if (commandCooldowns.TryAdd(tosave, userId))