adjusted for fellows
Browse files
app.py
CHANGED
@@ -84,9 +84,8 @@ async def safetychecks(ctx):
|
|
84 |
await ctx.reply(f"β
{bot} is online")
|
85 |
|
86 |
#β
β
check if the command is in the allowed channel(s)
|
87 |
-
channel_id =
|
88 |
-
|
89 |
-
if ctx.channel.id not in channel_ids: # #bot-test = 1100458786826747945, #testing-the-bot = 1113182673859518514
|
90 |
print(f"If using a command, commands are not permitted in {ctx.channel}")
|
91 |
return False
|
92 |
else:
|
@@ -94,31 +93,14 @@ async def safetychecks(ctx):
|
|
94 |
|
95 |
#β
β
check if the user has the required role(s)
|
96 |
guild_id = 879548962464493619
|
97 |
-
required_role_id =
|
98 |
-
allowed_role_ids = [897376942817419265, 963431900825919498]
|
99 |
guild = bot.get_guild(guild_id)
|
100 |
-
user_roles = ctx.author.roles
|
101 |
-
has_allowed_role = any(role.id in allowed_role_ids for role in user_roles)
|
102 |
-
if not has_allowed_role:
|
103 |
-
print("Error: The user does not have any of the required roles to use that command.")
|
104 |
-
return False
|
105 |
-
else:
|
106 |
-
allowed_roles = [role for role in user_roles if role.id in allowed_role_ids]
|
107 |
-
roles_str = ", ".join([role.name for role in allowed_roles])
|
108 |
-
await ctx.reply(f"β
{ctx.author} has the required role(s): {roles_str}")
|
109 |
-
|
110 |
-
|
111 |
-
'''
|
112 |
required_role = guild.get_role(required_role_id)
|
113 |
if required_role not in ctx.author.roles:
|
114 |
print(f"Error: The user does not have the required role to use that command. ({required_role} is the correct role)")
|
115 |
return False
|
116 |
else:
|
117 |
await ctx.reply(f"β
{ctx.author} has the required role {required_role}")
|
118 |
-
|
119 |
-
return True
|
120 |
-
|
121 |
-
'''
|
122 |
|
123 |
|
124 |
# ping lunarflu if any safety check ever fails
|
@@ -423,7 +405,7 @@ async def on_reaction_add(reaction, user): # ctx = await bot.get_context(reac
|
|
423 |
threadparentid = thread.parent.id
|
424 |
|
425 |
if not user.bot:
|
426 |
-
if threadparentid ==
|
427 |
# 811235357663297546 = lunarflu
|
428 |
if reaction.message.attachments:
|
429 |
if user.id == reaction.message.mentions[0].id: # if user.id == reaction.message.mentions[0].id:
|
|
|
84 |
await ctx.reply(f"β
{bot} is online")
|
85 |
|
86 |
#β
β
check if the command is in the allowed channel(s)
|
87 |
+
channel_id = 1113182673859518514
|
88 |
+
if ctx.channel.id != channel_id: # #bot-test = 1100458786826747945
|
|
|
89 |
print(f"If using a command, commands are not permitted in {ctx.channel}")
|
90 |
return False
|
91 |
else:
|
|
|
93 |
|
94 |
#β
β
check if the user has the required role(s)
|
95 |
guild_id = 879548962464493619
|
96 |
+
required_role_id = 963431900825919498 # @verified = 900063512829755413, HF = 897376942817419265, fellows = 963431900825919498
|
|
|
97 |
guild = bot.get_guild(guild_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
required_role = guild.get_role(required_role_id)
|
99 |
if required_role not in ctx.author.roles:
|
100 |
print(f"Error: The user does not have the required role to use that command. ({required_role} is the correct role)")
|
101 |
return False
|
102 |
else:
|
103 |
await ctx.reply(f"β
{ctx.author} has the required role {required_role}")
|
|
|
|
|
|
|
|
|
104 |
|
105 |
|
106 |
# ping lunarflu if any safety check ever fails
|
|
|
405 |
threadparentid = thread.parent.id
|
406 |
|
407 |
if not user.bot:
|
408 |
+
if threadparentid == 1113182673859518514: # bot-test
|
409 |
# 811235357663297546 = lunarflu
|
410 |
if reaction.message.attachments:
|
411 |
if user.id == reaction.message.mentions[0].id: # if user.id == reaction.message.mentions[0].id:
|