Merge pull request #14 from victormylle/dev_check

Dev check
This commit is contained in:
Stijn De Clercq
2020-09-29 23:23:40 +02:00
committed by GitHub
2 changed files with 27 additions and 0 deletions

13
data/constants.py Normal file
View File

@@ -0,0 +1,13 @@
# Our Discord User ID's
stijnID = 171671190631481345
victorID = 632196710323585025
wcbID = 760529466027016252
devIDs = [stijnID, victorID]
# Admin role ID's
roleAdmin = 730709756125249588
roleMod = 688328855605346339
roleOwner = 687996070986383436
adminRoles = [roleAdmin, roleOwner]
modPlusRoles = [roleAdmin, roleMod, roleOwner]

14
functions/checks.py Normal file
View File

@@ -0,0 +1,14 @@
from data import constants
# Checks if an author is a dev
def isDev(ctx):
return ctx.author.id in constants.devIDs
def isAdmin(ctx):
return isDev(ctx) or any(role.id in constants.adminRoles for role in ctx.author.roles)
def isModPlus(ctx):
return isDev(ctx) or any(role.id in constants.modPlusRoles for role in ctx.author.roles)