mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 15:44:57 +00:00
Update checks.py
This commit is contained in:
parent
6a8e066281
commit
db2dea30a3
1 changed files with 43 additions and 1 deletions
42
checks.py
42
checks.py
|
@ -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
|
||||
|
@ -48,6 +59,27 @@ def is_mod_or_has_perms(**permissions):
|
|||
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():
|
||||
def predicate(ctx):
|
||||
user = ctx.message.author
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue