Skip to main content

FriendMessage

Represents a message sent by a friend.

Properties

client

Type: Client The client instance.

author

Type: Friend The author of the message.

content

Type: str The content of the message.

created_at

Type: datetime.datetime The time when this message was received in UTC.

Methods

reply

await reply(content: str) -> None
Replies to the message with the given content. Parameters:
  • content (str) - The content of the message, up to 256 characters.
Raises:
  • ChatError - Content is longer than 256 characters.
Example:
@client.event
async def event_friend_message(message):
    if message.content.lower() == 'hello':
        await message.reply('Hi there!')