0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Py-cord v2.6「discord.ui.Modal」

Posted at

「discord.ui.Modal」セクションの和訳

Modalクラスの引数

  • children(discord.ui.InputText)
    • Modalに表示されるメッセージ
  • title(任意の文字列)
    • Modalのタイトル
  • custom_id(任意の文字列 ※省略可)
    • ModalにつけることができるカスタムID
  • timeout(Float型の数 ※省略可)
    • 最後の操作から一定時間操作がなかった場合、Modal処理を中止させる

Modalクラスのメゾッド

  • await callback(interaction)
    • Modal送信後の処理を行う
    • 引数「interaction」
      • discord.Interaction
  • add_item(item)
    • Modalにテキスト入力欄を追加する
    • 引数「item」
      • discord.ui.InputText
  • remove_item(item)
    • add_itemで追加した入力欄を削除する
    • 引数「item」
      • dicord.ui.InputText
  • stop()
    • Modal操作の監視を終了する
  • await wait()
    • Modal操作の終了を待つ
    • bool値を返す
  • await on_error(error, interaction)
    • エラーハンドラー
  • await on_timeout()
    • タイムアウト後の処理

参考資料:公式ドキュメントのModalセクション

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?