diff options
author | suhas <hi@suhas.one> | 2023-11-22 23:38:22 -0600 |
---|---|---|
committer | suhas <hi@suhas.one> | 2023-11-22 23:38:22 -0600 |
commit | 7d9f370dedd776d5b4d859818bf2254e21d58102 (patch) | |
tree | d444ca7e8dfc5601fc857618552998ba1fd30120 /bot.py | |
parent | c3dfa5bffa3f9da233dccc3c18e62e751688554d (diff) | |
download | qbb-main.tar.gz |
Diffstat (limited to 'bot.py')
-rw-r--r-- | bot.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bot.py b/bot.py index 6c3dcd3..987cb00 100644 --- a/bot.py +++ b/bot.py @@ -11,13 +11,17 @@ import asyncio load_dotenv() -if getenv('TOKEN') is None or getenv('OWNER_ID') is None: +token = getenv('TOKEN') +owner_id = getenv('OWNER_ID') +if token is None or owner_id is None: print('please set a TOKEN and OWNER_ID environment variable') exit(1) class QBBBot(Bot): def __init__(self) -> None: - super().__init__(command_prefix=when_mentioned, intents=Intents.default()) + i = Intents.default() + i.members = True + super().__init__(command_prefix=when_mentioned, intents=i) async def setup_hook(self): await self.load_extension('cogs.tossup') @@ -28,16 +32,15 @@ class QBBBot(Bot): bot = QBBBot() -bot.qb_categories = Literal['Literature', 'History', 'Science', 'Fine Arts', 'Religion', 'Mythology', 'Philosophy', - 'Social Science', 'Current Events', 'Geography', 'Other Academic', 'Trash'] + @bot.command() async def sync(ctx: Context): - if str(ctx.author.id) == getenv('OWNER_ID'): + if str(ctx.author.id) == owner_id: await bot.tree.sync() await ctx.send('ok') else: await ctx.send('no') -bot.run(getenv('TOKEN')) +bot.run(token) |