mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-23 02:05:36 +00:00
bbeaa8049e
I didn't face this on official RS one but one of forks had the issue so /shrug
36 lines
935 B
Python
36 lines
935 B
Python
import config
|
|
|
|
|
|
def check_if_staff(ctx):
|
|
if not ctx.guild:
|
|
return False
|
|
return any(r.id in config.staff_role_ids for r in ctx.author.roles)
|
|
|
|
|
|
def check_if_bot_manager(ctx):
|
|
if not ctx.guild:
|
|
return False
|
|
return any(r.id == config.bot_manager_role_id for r in ctx.author.roles)
|
|
|
|
|
|
def check_if_staff_or_ot(ctx):
|
|
if not ctx.guild:
|
|
return True
|
|
is_ot = (ctx.channel.name == "off-topic")
|
|
is_bot_cmds = (ctx.channel.name == "bot-cmds")
|
|
is_staff = any(r.id in config.staff_role_ids for r in ctx.author.roles)
|
|
return (is_ot or is_staff or is_bot_cmds)
|
|
|
|
|
|
def check_if_collaborator(ctx):
|
|
if not ctx.guild:
|
|
return False
|
|
return any(r.id in config.staff_role_ids + config.allowed_pin_roles
|
|
for r in ctx.author.roles)
|
|
|
|
|
|
def check_if_pin_channel(ctx):
|
|
if not ctx.guild:
|
|
return False
|
|
return ctx.message.channel.id in config.allowed_pin_channels
|