-

interactions#

+

interactions#

-class DeleteMessageButton(*, style=<ButtonStyle.secondary: 2>, label='Delete', **kwargs)[source]#
+class DeleteMessageButton(*, style=('secondary', 2), label='Delete', **kwargs)[source]#

Bases: Button

A button that can be added to a view to delete the message containing the view on click.

This button itself carries out no interaction checks, these should be done by the parent view.

@@ -431,22 +435,22 @@
Parameters:
  • style (ButtonStyle) – The style of the button, set to ButtonStyle.secondary if not specified.

  • -
  • label (str) – The label of the button, set to “Delete” if not specified.

  • +
  • label (str) – The label of the button, set to “Delete” if not specified.

-__init__(*, style=<ButtonStyle.secondary: 2>, label='Delete', **kwargs)[source]#
+__init__(*, style=('secondary', 2), label='Delete', **kwargs)[source]#
-async callback(interaction)[source]#
+async callback(interaction)[source]#

Delete the original message on button click.

Return type:
-

None

+

None

@@ -455,47 +459,47 @@
-class ViewWithUserAndRoleCheck(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#
+class ViewWithUserAndRoleCheck(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#

Bases: View

A view that allows the original invoker and moderators to interact with it.

Parameters:
    -
  • allowed_users (Sequence[int]) – A sequence of user’s ids who are allowed to interact with the view.

  • -
  • allowed_roles (Sequence[int]) – A sequence of role ids that are allowed to interact with the view.

  • -
  • timeout (Optional[float]) – Timeout in seconds from last interaction with the UI before no longer accepting input. +

  • allowed_users (Sequence[int]) – A sequence of user’s ids who are allowed to interact with the view.

  • +
  • allowed_roles (Sequence[int]) – A sequence of role ids that are allowed to interact with the view.

  • +
  • timeout (Optional[float]) – Timeout in seconds from last interaction with the UI before no longer accepting input. If None then there is no timeout.

  • -
  • message (Optional[Message]) – The message to remove the view from on timeout. This can also be set with +

  • message (Optional[Message]) – The message to remove the view from on timeout. This can also be set with view.message = await ctx.send( ... )` , or similar, after the view is instantiated.

-__init__(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#
+__init__(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#
-async interaction_check(interaction)[source]#
+async interaction_check(interaction)[source]#

Ensure the user clicking the button is the view invoker, or a moderator.

Parameters:

interaction (Interaction) – The interaction that occurred.

Return type:
-

bool

+

bool

-async on_timeout()[source]#
+async on_timeout()[source]#

Remove the view from self.message if set.

Return type:
-

None

+

None

@@ -582,10 +586,10 @@ If None - - - - - + + + + + \ No newline at end of file -- cgit v1.2.3