curious.dataclasses.message¶
Wrappers for Message objects.
Classes
Message(client, **kwargs) |
Represents a Message. |
MessageType |
Represents the type of a message. |
-
class
curious.dataclasses.message.MessageType[source]¶ Bases:
enum.IntEnumRepresents the type of a message.
-
DEFAULT= 0¶ The default (i.e. user message) type.
-
RECIPIENT_ADD= 1¶ The recipient add type, used when a recipient is added to a group.
-
RECIPIENT_REMOVE= 2¶ The recipient remove type, used when a recipient is added to a group.
-
CALL= 3¶ The call type, used when a call is started.
-
CHANNEL_NAME_CHANGE= 4¶ The channel name change type, used when a group channel name is changed.
-
CHANNEL_ICON_CHANGE= 5¶ The channel icon change type, used when a group channel icon is changed.
-
CHANNEL_PINNED_MESSAGE= 6¶ The channel pinned message type, used when a message is pinned.
-
GUILD_MEMBER_JOIN= 7¶ The guild member join type, used when a member joins a guild.
-
-
class
curious.dataclasses.message.Message(client, **kwargs)[source]¶ Bases:
curious.dataclasses.bases.DataclassRepresents a Message.
Inspects the stack to ensure we’re being called correctly.
-
content¶ The content of the message.
-
guild_id¶ The ID of the guild this message is in.
-
channel_id¶ The ID of the channel the message was sent in.
The ID of the author.
-
type¶ The type of this message.
-
created_at¶ The true timestamp of this message, a
datetime.datetime. This is not the snowflake timestamp.
-
edited_timestamp= None¶ The edited timestamp of this message. This can sometimes be None.
-
attachments¶ The list of
Attachmentthis message contains.
-
_mentions¶ The mentions for this message. This is UNORDERED.
-
_role_mentions¶ The role mentions for this message. This is UNORDERED.
-
reactions¶ The reactions for this message.
-
mentions¶ Returns a list of
Memberthat were mentioned in this message.Warning
The mentions in this will not be in order. Discord does not return them in any particular order.
Return type: List[Member]
-
role_mentions¶ Returns a list of
Rolethat were mentioned in this message.Warning
The mentions in this will not be in order. Discord does not return them in any particular order.
Return type: List[Role]
-
channel_mentions¶ Returns a list of
Channelthat were mentioned in this message.Note
These mentions are in order. They are parsed from the message content.
Return type: List[Channel]
-
invites¶ Returns a list of
Inviteobjects that are in this message (and valid).Return type: AsyncIterator[Invite]
-
_resolve_mentions(mentions, type_)[source]¶ Resolves the mentions for this message.
Parameters: Return type:
-
reacted(emoji)[source]¶ Checks if this message was reacted to with the specified emoji.
Parameters: emoji ( Union[Emoji,str]) – The emoji to check.Return type: bool
-
await
delete()[source]¶ Deletes this message.
You must have MANAGE_MESSAGE permissions to delete this message, or have it be your own message.
Return type: None
-
await
edit(new_content=None, *, embed=None)[source]¶ Edits this message.
You must be the owner of this message to edit it.
Parameters: Return type: Returns: This message, but edited with the new content.
-
await
pin()[source]¶ Pins this message.
You must have MANAGE_MESSAGES in the channel to pin the message.
Return type: Message
-
await
unpin()[source]¶ Unpins this message.
You must have MANAGE_MESSAGES in this channel to unpin the message. Additionally, the message must already be pinned.
Return type: Message
-
await
get_who_reacted(emoji)[source]¶ Fetches who reacted to this message.
Parameters: emoji ( Union[Emoji,str]) – The emoji to check.Return type: List[Union[User,Member]]Returns: A list of either MemberorUserthat reacted to this message.
-
await
react(emoji)[source]¶ Reacts to a message with an emoji.
This requires an Emoji object for reacting to messages with custom reactions, or a string containing the literal unicode (e.g ™) for normal emoji reactions.
Parameters: emoji ( Union[Emoji,str]) – The emoji to react with.
-