/v2-slash-command

🤖 discord.py v2.0を使用したスラッシュコマンドの実装サンプル

Primary LanguagePython

v2-slash-command


discord.py-v2 を使用したスラッシュコマンドの実装

  • ギルドコマンド
  • グローバルコマンド
  • サブコマンドを使用したコマンド
  • オプション(引数)を使用したコマンド

discord.py v2.0に関する知見はここに書いてます。

📝 Requirements

開発バージョンである v2.0.0a を使用します。
正式リリースされた後は、最新版のものを使用することを推奨します。

$ git clone https://github.com/Rapptz/discord.py
$ cd discord.py
$ python3 -m pip install -U .[voice]

https://github.com/Rapptz/discord.py#installing

🔧 Expand / Customize

拡張する場合、引数ctxに渡される型がInteractionであることに注意してください。
そのほか、単純にv2.0移行時にいくつかの変更が行われています。
https://discordpy.readthedocs.io/ja/latest/migrating.html