Skip to content

Resources


message

Message dataclass

Bases: BaseResource


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

                              scurrypy.resources.base_resource.BaseResource --> 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"
            

Represents a Discord message resource.

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.

Permissions

Requires VIEW_CHANNEL and READ_MESSAGE_HISTORY

Returns:

edit async

Edits this message.

Fires Message Update Event.

Permissions

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

Note

Existing message flags are not automatically preserved. Flags are reset unless explicitly specified.

Parameters:

  • options (EditMessageParams) –

    fields to edit for the message

  • suppress_embeds (bool, default: False ) –

    whether to suppress embeds. Defaults to False.

  • is_components_v2 (bool, default: False ) –

    whether V2 components are in this message. Defaults to False.

Returns:

crosspost async

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

Fires Message Update Event.

Permissions

Requires SEND_MESSAGES to publish your own messages

Requires MANAGE_MESSAGES to publish messages from others

Returns:

  • JsonQuery –

    published (crossposted) message

delete async

Deletes this message.

Fires Message Delete.

Permissions

Requires MANAGE_MESSAGES

pin async

Pin this message to its channel's pins.

Fires Channel Pins Update.

Permissions

Requires PIN_MESSAGES

unpin async

Unpin this message from its channel's pins.

Fires Channel Pins Update.

Permissions

Requires PIN_MESSAGES

fetch_emoji_reactions async

Fetches users who reacted with the specified emoji parameters.

Parameters:

  • emoji (EmojiPart | str) –

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

  • 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:

  • JsonQuery –

    list of users who reacted with this emoji

add_reaction async

Add a reaction to this message.

Fires Message Reaction Add.

Permissions

Requires READ_MESSAGE_HISTORY.

Requires ADD_REACTIONS of no reactions with this emoji are present.

Parameters:

  • emoji (EmojiPart | str) –

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

remove_reaction async

Remove the bot's reaction from this message.

Fires Message Reaction Remove.

Parameters:

  • emoji (EmojiPart | str) –

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

remove_user_reaction async

Remove a specific user's reaction from this message.

Fires Message Reaction Remove.

Permissions

Requires MANAGE_MESSAGES

Parameters:

  • emoji (EmojiPart | str) –

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

  • user_id (Snowflake) –

    user's ID

remove_emoji_reaction async

Clear all reactions for a given emoji from this message. Fires Message Reaction Remove Emoji.

Permissions

Requires MANAGE_MESSAGES

Parameters:

  • emoji (EmojiPart | str) –

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

remove_all_reactions async

Clear all reactions from this message.

Fires Message Reaction Remove All.

Permissions

Requires MANAGE_MESSAGES