Failing to check

15 hours ago 1
ARTICLE AD BOX

Basically, im trying to make a whitelist where only certain roles can use this command, and it logs a role as being "theirs", I have tried debugging by printing roles and stuff and now It is not even going through the check, like it will print the admin table, but then dosent move onto the check where it adds to the db/sends a message, it does nothing.

cogs/roles.py

import discord from discord.ext import commands from utils.databases import roles_db from utils.variables import admin class Roles(commands.Cog): def __init__(self, bot): self.bot = bot @commands.hybrid_group() async def custom(self, ctx: commands.Context): return @custom.command(name="register", description="Registers a custom role to a user") async def register(self, ctx: commands.Context, role: discord.Role, member: discord.Member): print(admin) if any(r.id in admin for r in ctx.author.roles): roles_db.insert_one({"user_id": member.id, "role_id": role.id}) await ctx.send(":white_check_mark: Role registered!") else: await ctx.send(":x: You do not have the required role.") async def setup(bot): await bot.add_cog(Roles(bot))

utils/variables.py

admin = [ 1408442799925235794, 1445017368123277460 1079504634772738078 1272691594591473695 1379137477192843264 ]
Read Entire Article