mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Add intents to examples
This commit is contained in:
parent
1518790c87
commit
4bce41f7aa
@ -1,3 +1,5 @@
|
|||||||
|
# This example requires the 'members' privileged intents
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import random
|
import random
|
||||||
@ -6,7 +8,11 @@ description = '''An example bot to showcase the discord.ext.commands extension
|
|||||||
module.
|
module.
|
||||||
|
|
||||||
There are a number of utility commands being showcased here.'''
|
There are a number of utility commands being showcased here.'''
|
||||||
bot = commands.Bot(command_prefix='?', description=description)
|
|
||||||
|
intents = discord.Intents.default()
|
||||||
|
intents.members = True
|
||||||
|
|
||||||
|
bot = commands.Bot(command_prefix='?', description=description, intents=intents)
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# This example requires the 'members' privileged intents
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
|
|
||||||
class MyClient(discord.Client):
|
class MyClient(discord.Client):
|
||||||
@ -14,5 +16,8 @@ class MyClient(discord.Client):
|
|||||||
await guild.system_channel.send(to_send)
|
await guild.system_channel.send(to_send)
|
||||||
|
|
||||||
|
|
||||||
client = MyClient()
|
intents = discord.Intents.default()
|
||||||
|
intents.members = True
|
||||||
|
|
||||||
|
client = MyClient(intents=intents)
|
||||||
client.run('token')
|
client.run('token')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user