Skip to content

Resources


message

Message dataclass

Bases: BaseResource, _EditMessageMixin


              flowchart TD
              scurrypy.resources.message.Message[Message]
              scurrypy.resources.base_resource.BaseResource[BaseResource]
              scurrypy.resources.message._EditMessageMixin[_EditMessageMixin]

                              scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.message.Message
                
                scurrypy.resources.message._EditMessageMixin --> scurrypy.resources.message.Message
                


              click scurrypy.resources.message.Message href "" "scurrypy.resources.message.Message"
              click scurrypy.resources.base_resource.BaseResource href "" "scurrypy.resources.base_resource.BaseResource"
              click scurrypy.resources.message._EditMessageMixin href "" "scurrypy.resources.message._EditMessageMixin"
            

A Discord message.

id: Snowflake instance-attribute

ID of the message

channel_id: Snowflake instance-attribute

Channel ID of the message.

fetch async

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

Returns:

edit async

Edits this message. Fires MessageUpdateEvent.

Permissions

Requires MANAGE_MESSAGES only if editing another user's message or to edit flags

Parameters:

  • options (EditMessageParams, default: {} ) –

    fields to edit for the message

  • suppress_embeds ((optional, bool), default: None ) –

    whether the response's embeds should be removed

Returns:

crosspost async

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

Permissions

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

Returns:

delete async

Deletes this message. Fires MessageDeleteEvent.

pin async

Pin this message to its channel's pins. Fires ChannelPinsUpdateEvent.

unpin async

Unpin this message from its channel's pins. Fires ChannelPinsUpdateEvent.

fetch_emoji_reactions async

Fetches users who reacted with the specified emoji parameters.

Parameters:

  • emoji (EmojiModel | str) –

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

  • type (ReactionType, default: NORMAL ) –

    Type of emoji. Defaults to ReactionType.NORMAL.

  • after (int, default: None ) –

    users after this ID

  • limit (int, default: 25 ) –

    Max number of users to return. Defaults to 25.

Returns:

  • list[UserModel]

    list[UserModel]: list of users who reacted with this emoji

add_reaction async

Add a reaction to this message. Fires MessageReactionAddEvent.

Permissions

Requires READ_MESSAGE_HISTORY and ADD_REACTIONS

Parameters:

  • emoji (EmojiModel | str) –

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

remove_reaction async

Remove the bot's reaction from this message. Fires MessageReactionRemoveEvent.

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. Fires MessageReactionRemoveEvent.

Permissions

Requires MANAGE_MESSAGES

Parameters:

  • emoji (EmojiModel | str) –

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

  • user_id (Snowflake) –

    user's ID

remove_emoji_reaction async

Clear all reactions for a given emoji from this message.

Permissions

Requires MANAGE_MESSAGES

Parameters:

  • emoji (EmojiModel | str) –

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

remove_all_reactions async

Clear all reactions from this message. Fires MessageReactionRemoveAllEvent.

Permissions

Requires MANAGE_MESSAGES