Skip to content

Message Resource

Note

The following classes come from the scurrypy.resources.message module.


Message dataclass

Bases: BaseResource

A Discord message.

id: int instance-attribute

ID of the message

channel_id: int instance-attribute

Channel ID of the message.

context: Any instance-attribute

Associated user data.

fetch async

Fetches the message data based on the given channel ID and message id.

Returns:

send async

Sends a new message to the current channel.

Permissions
  • SEND_MESSAGES → required to senf your own messages

Parameters:

  • message (str | MessagePart) –

    can be just text or the MessagePart for dynamic messages

Returns:

  • MessageModel

    the new Message object with all fields populated

edit async

Edits this message.

Permissions
  • MANAGE_MESSAGES → ONLY if editing another user's message

Parameters:

  • message (str | MessagePart) –

    can be just text or the MessagePart for dynamic messages

Returns:

crosspost async

Crosspost this message in an Annoucement channel to all following channels.

Permissions
  • SEND_MESSAGES → required to publish your own messages
  • MANAGE_MESSAGES → required to publish messages from others

Returns:

delete async

Deletes this message.

add_reaction async

Add a reaction from this message.

Permissions
  • READ_MESSAGE_HISTORY → required to view message
  • ADD_REACTIONS → required to create reaction

Parameters:

  • emoji (EmojiModel | str) –

    the standard emoji (str) or custom emoji (EmojiModel)

remove_reaction async

Remove the bot's reaction from this message.

Parameters:

  • emoji (EmojiModel | str) –

    the standard emoji (str) or custom emoji (EmojiModel)

remove_user_reaction async

Remove a specific user's reaction from this message.

Permissions
  • MANAGE_MESSAGES → required to remove another user's reaction

Parameters:

  • emoji (EmojiModel | str) –

    the standard emoji (str) or custom emoji (EmojiModel)

  • user_id (int) –

    user's ID

remove_all_reactions async

Clear all reactions from this message.

Permissions
  • MANAGE_MESSAGES → required to remove all reaction

pin async

Pin this message to its channel's pins.

unpin async

Unpin this message from its channel's pins.