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–the message object
send
async
¶
Sends a new message to the current channel.
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.
Parameters:
-
message(str | MessagePart) –can be just text or the MessagePart for dynamic messages
Returns:
-
MessageModel–the edited message
crosspost
async
¶
Crosspost this message in an Annoucement channel to all following channels.
Returns:
-
MessageModel–the published (crossposted) message
delete
async
¶
Deletes this message.
add_reaction
async
¶
Add a reaction from this message.
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.
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.
pin
async
¶
Pin this message to its channel's pins.
unpin
async
¶
Unpin this message from its channel's pins.