Created
September 23, 2022 02:31
-
-
Save TomXV/73b66900f3a78eeb95aff490e71cccf6 to your computer and use it in GitHub Desktop.
「TypeError: __init__() missing 1 required keyword-only argument: 'intents' 」の解決方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#DiscordのAPIが9月に変わったので、その書き方です。 | |
#Before Codes | |
client = discord.Client() | |
#also | |
client = commands.Bot(command_prefix='!') | |
#After Codes | |
intents = discord.Intents.default() | |
intents.message_content = True | |
client = discord.Client(intents=intents) | |
#also | |
intents = discord.Intents.default() | |
intents.message_content = True | |
client = commands.Bot(command_prefix='!', intents=intents) | |
# discord.devで、ゲートウェイ設定でMESSAGE CONTENT INTENTを有効にする。 | |
# discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents | |
# that have not been explicitly enabled in the developer portal. It is recommended to go to | |
# https://discord.com/developers/applications/ and explicitly enable the privileged intents | |
# within your application's page. If this is not possible, then consider disabling the privileged intents instead. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
9月頃にDiscord APIの仕様変更がありました。