Update checks.py

This commit is contained in:
Elmon11 2020-10-31 03:05:32 +01:00 committed by GitHub
parent 6a8e066281
commit db2dea30a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,11 @@ import discord
from discord.ext import commands
telnet_ip = [IP]
telnet_port = [PORT]
telnet_password = [PASSWORD]
telnet_username = 'TotalFreedom'
server_liaison = 769659653096472634
event_host = 769659653096472629
server_banned = 769659653096472636
@ -15,6 +20,12 @@ mentions_channel_id = 769659654027739151
discord_admin = 769659653129896025
discord_mod = 769659653129896023
devs = [114348811995840515, 147765181903011840]
bot_logs_channel_id = 771391406609662013
executive = 769659653129896019
asst_exec = 769659653129896018
developer = 769659653129896017
creative_designer = 771748500576141332
master_builder = 769659653121900550
class no_permission(commands.MissingPermissions):
pass
@ -45,7 +56,28 @@ def is_mod_or_has_perms(**permissions):
if role.id in [discord_mod, discord_admin] or permissions:
return True
else:
raise no_permission(['IS_MOD_OR_HAS_PERMS'])
raise no_permission(['IS_MOD_OR_HAS_PERMS'])
return commands.check(predicate)
def is_executive():
def predicate(ctx):
user = ctx.message.author
for role in user.roles:
if role.id in [executive, asst_exec]:
return True
else:
raise no_permission(['IS_EXECUTIVE'])
return commands.check(predicate)
def is_tf_developer():
def predicate(ctx):
user = ctx.message.author
for role in user.roles:
if role.id == developer:
return True
else:
raise no_permission(['IS_TOTALFREEDOM_DEVELOPER'])
return commands.check(predicate)
def is_liaison():
@ -58,6 +90,16 @@ def is_liaison():
raise no_permission(['IS_SERVER_LIAISON'])
return commands.check(predicate)
def is_creative_designer():
def predicate(ctx):
user = ctx.message.author
for role in user.roles:
if role.id == creative_designer:
return True
else:
raise no_permission(['IS_CREATIVE_DESIGNER'])
return commands.check(predicate)
def is_senior():
def predicate(ctx):
user = ctx.message.author