Skip to content

Commit

Permalink
Fix advanced startup example
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Sep 17, 2023
1 parent 4ed08dd commit 3530a0f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions examples/advanced_startup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This example requires the 'message_content' privileged intent to function, however your own bot might not.

# This example covers advanced startup options and uses some real world examples for why you may need them.

import asyncio
Expand Down Expand Up @@ -88,9 +90,16 @@ async def main():
# 2. We become responsible for starting the bot.

exts = ['general', 'mod', 'dice']
async with CustomBot(commands.when_mentioned, db_pool=pool, web_client=our_client, initial_extensions=exts) as bot:

await bot.start(os.getenv('TOKEN', ''))
intents = discord.Intents.default()
intents.message_content = True
async with CustomBot(
commands.when_mentioned,
db_pool=pool,
web_client=our_client,
initial_extensions=exts,
intents=intents,
) as bot:
await bot.start('token')


# For most use cases, after defining what needs to run, we can just tell asyncio to run it:
Expand Down

0 comments on commit 3530a0f

Please sign in to comment.