Skip to content

Commit 3530a0f

Browse files
committed
Fix advanced startup example
1 parent 4ed08dd commit 3530a0f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

examples/advanced_startup.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This example requires the 'message_content' privileged intent to function, however your own bot might not.
2+
13
# This example covers advanced startup options and uses some real world examples for why you may need them.
24

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

9092
exts = ['general', 'mod', 'dice']
91-
async with CustomBot(commands.when_mentioned, db_pool=pool, web_client=our_client, initial_extensions=exts) as bot:
92-
93-
await bot.start(os.getenv('TOKEN', ''))
93+
intents = discord.Intents.default()
94+
intents.message_content = True
95+
async with CustomBot(
96+
commands.when_mentioned,
97+
db_pool=pool,
98+
web_client=our_client,
99+
initial_extensions=exts,
100+
intents=intents,
101+
) as bot:
102+
await bot.start('token')
94103

95104

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

0 commit comments

Comments
 (0)