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("
else:
await ctx.send("
async def setup(bot):
await bot.add_cog(Roles(bot))
utils/variables.py
admin = [
1408442799925235794,
1445017368123277460
1079504634772738078
1272691594591473695
1379137477192843264
]