From 15bd93a9f9be7006365c6c08647da422aea388c4 Mon Sep 17 00:00:00 2001 From: Gakuto Furuya <57865205+gaato@users.noreply.github.com> Date: Thu, 31 Mar 2022 07:33:09 +0900 Subject: [PATCH] Update README code example --- README.ja.rst | 8 ++++++-- README.rst | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.ja.rst b/README.ja.rst index 11deab899..531c9abd8 100644 --- a/README.ja.rst +++ b/README.ja.rst @@ -84,7 +84,9 @@ Linuxで音声サポートを導入するには、前述のコマンドを実行 if message.content == 'ping': await message.channel.send('pong') - client = MyClient() + intents = discord.Intents.default() + intents.message_content = True + client = MyClient(intents=intents) client.run('token') Botの例 @@ -95,7 +97,9 @@ Botの例 import discord 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() async def ping(ctx): diff --git a/README.rst b/README.rst index dd2df58ec..83d43a076 100644 --- a/README.rst +++ b/README.rst @@ -84,7 +84,9 @@ Quick Example if message.content == 'ping': await message.channel.send('pong') - client = MyClient() + intents = discord.Intents.default() + intents.message_content = True + client = MyClient(intents=intents) client.run('token') Bot Example @@ -95,7 +97,9 @@ Bot Example import discord 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() async def ping(ctx):