mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Update README code example
This commit is contained in:
parent
e515378076
commit
15bd93a9f9
@ -84,7 +84,9 @@ Linuxで音声サポートを導入するには、前述のコマンドを実行
|
|||||||
if message.content == 'ping':
|
if message.content == 'ping':
|
||||||
await message.channel.send('pong')
|
await message.channel.send('pong')
|
||||||
|
|
||||||
client = MyClient()
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
|
client = MyClient(intents=intents)
|
||||||
client.run('token')
|
client.run('token')
|
||||||
|
|
||||||
Botの例
|
Botの例
|
||||||
@ -95,7 +97,9 @@ Botの例
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
bot = commands.Bot(command_prefix='>')
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
|
bot = commands.Bot(command_prefix='>', intents=intents)
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def ping(ctx):
|
async def ping(ctx):
|
||||||
|
@ -84,7 +84,9 @@ Quick Example
|
|||||||
if message.content == 'ping':
|
if message.content == 'ping':
|
||||||
await message.channel.send('pong')
|
await message.channel.send('pong')
|
||||||
|
|
||||||
client = MyClient()
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
|
client = MyClient(intents=intents)
|
||||||
client.run('token')
|
client.run('token')
|
||||||
|
|
||||||
Bot Example
|
Bot Example
|
||||||
@ -95,7 +97,9 @@ Bot Example
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
bot = commands.Bot(command_prefix='>')
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
|
bot = commands.Bot(command_prefix='>', intents=intents)
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def ping(ctx):
|
async def ping(ctx):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user