mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 15:06:07 +00:00
Fix advanced startup example
This commit is contained in:
parent
4ed08dd4a7
commit
3530a0f2a8
@ -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.
|
# This example covers advanced startup options and uses some real world examples for why you may need them.
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
@ -88,9 +90,16 @@ async def main():
|
|||||||
# 2. We become responsible for starting the bot.
|
# 2. We become responsible for starting the bot.
|
||||||
|
|
||||||
exts = ['general', 'mod', 'dice']
|
exts = ['general', 'mod', 'dice']
|
||||||
async with CustomBot(commands.when_mentioned, db_pool=pool, web_client=our_client, initial_extensions=exts) as bot:
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
await bot.start(os.getenv('TOKEN', ''))
|
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:
|
# For most use cases, after defining what needs to run, we can just tell asyncio to run it:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user