From 99ac871654998741fe5bfd5392cc694897901443 Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Tue, 29 Sep 2020 23:22:50 +0200 Subject: [PATCH] Create constants & dev checks Fixes #13 --- data/constants.py | 13 +++++++++++++ functions/checks.py | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 data/constants.py create mode 100644 functions/checks.py diff --git a/data/constants.py b/data/constants.py new file mode 100644 index 0000000..b143685 --- /dev/null +++ b/data/constants.py @@ -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] diff --git a/functions/checks.py b/functions/checks.py new file mode 100644 index 0000000..4b08939 --- /dev/null +++ b/functions/checks.py @@ -0,0 +1,15 @@ +import discord +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)