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:
-
MessageModel–queried message
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
Returns:
-
MessageModel–updated message
crosspost
async
¶
Crosspost this message in an Annoucement channel to all following channels.
Fires MessageUpdateEvent.
Permissions
SEND_MESSAGES→ required to publish your own messagesMANAGE_MESSAGES→ required to publish messages from others
Returns:
-
MessageModel–published (crossposted) message
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(int, default:NORMAL) –Type of emoji. Defaults to
ReactionTypes.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(int) –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