Skip to content

Instantly share code, notes, and snippets.

@TomXV
Created September 23, 2022 02:31
Show Gist options
  • Save TomXV/73b66900f3a78eeb95aff490e71cccf6 to your computer and use it in GitHub Desktop.
Save TomXV/73b66900f3a78eeb95aff490e71cccf6 to your computer and use it in GitHub Desktop.
「TypeError: __init__() missing 1 required keyword-only argument: 'intents' 」の解決方法
#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.
@TomXV
Copy link
Author

TomXV commented Sep 23, 2022

9月頃にDiscord APIの仕様変更がありました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment