Make some procs async

This commit is contained in:
SeanOMik 2020-06-18 18:10:21 -05:00
parent 28fd1c443a
commit 0c16ecada5
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import json, discordobject, nimcordutils import json, discordobject, nimcordutils, asyncdispatch
type type
PermissionType* = enum PermissionType* = enum
@ -62,7 +62,7 @@ proc hasPermission*(perms: Permissions, perm: Permission): bool =
## This also checks if it is not a part of the denyPerms. ## This also checks if it is not a part of the denyPerms.
return (perms.allowPerms and uint(perm)) == uint(perm) and (perms.denyPerms and uint(perm)) != uint(perm) return (perms.allowPerms and uint(perm)) == uint(perm) and (perms.denyPerms and uint(perm)) != uint(perm)
proc addAllowPermission*(perms: Permissions, perm: Permission): Permissions = proc addAllowPermission*(perms: Permissions, perm: Permission): Future[Permissions] {.async.} =
## Add a `Permission` to the `Permissions` allow values. ## Add a `Permission` to the `Permissions` allow values.
## If it finds the permission in denyPerms, it will remove it from that also. ## If it finds the permission in denyPerms, it will remove it from that also.
@ -72,7 +72,7 @@ proc addAllowPermission*(perms: Permissions, perm: Permission): Permissions =
perms.allowPerms = perms.allowPerms or uint(perm) perms.allowPerms = perms.allowPerms or uint(perm)
proc addDenyPermission*(perms: Permissions, perm: Permission): Permissions = proc addDenyPermission*(perms: Permissions, perm: Permission): Future[Permissions] {.async.} =
## Add a `Permission` to the `Permissions` deny values. ## Add a `Permission` to the `Permissions` deny values.
## If it finds the permission in allowPerms, it will remove it from that also. ## If it finds the permission in allowPerms, it will remove it from that also.