Skip to content
1 change: 0 additions & 1 deletion examples/background_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ async def my_background_task(self):
async def before_my_task(self):
await self.wait_until_ready() # Wait until the bot logs in


client = MyClient()
client.run("token")
1 change: 0 additions & 1 deletion examples/background_task_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ async def my_background_task(self):
await channel.send(counter)
await asyncio.sleep(60) # This asyncio task runs every 60 seconds


client = MyClient()
client.run("token")
3 changes: 2 additions & 1 deletion examples/basic_bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This example requires the 'members' privileged intents
# This example requires the 'members' and 'message_content' privileged intents

import random

Expand All @@ -12,6 +12,7 @@

intents = discord.Intents.default()
intents.members = True
intents.message_content = True

bot = commands.Bot(command_prefix="?", description=description, intents=intents)

Expand Down
5 changes: 5 additions & 0 deletions examples/basic_voice.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This example requires the 'message_content' privileged intent.

import asyncio

import youtube_dl
Expand Down Expand Up @@ -121,10 +123,13 @@ async def ensure_voice(self, ctx):
elif ctx.voice_client.is_playing():
ctx.voice_client.stop()

intents = discord.Intents.default()
intents.message_content = True

bot = commands.Bot(
command_prefix=commands.when_mentioned_or("!"),
description="Relatively simple music bot example",
intents=intents,
)


Expand Down
3 changes: 2 additions & 1 deletion examples/converters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This example requires the 'members' privileged intent to use the Member converter.
# This example requires the 'members' privileged intent to use the Member converter, and the 'message_content' privileged intent for prefixed commands.

import typing

Expand All @@ -7,6 +7,7 @@

intents = discord.Intents.default()
intents.members = True
intents.message_content = True

bot = commands.Bot("!", intents=intents)

Expand Down