semaphore.Message

class semaphore.Message(username: str, source: Address, envelope_type: int, timestamp: int, server_timestamp: int, sender: MessageSender, source_device: int = 0, relay: str = None, has_legacy_message: bool = False, has_content: bool = False, data_message: DataMessage | None = None, is_unidentified_sender: bool = False)[source]

Bases: object

This object represents a Signal message.

empty() bool[source]

Check if the message is not empty.

get_body() str[source]

Check if the message is not empty.

get_group_id() str | None[source]

Get group id if message is a group message.

async get_profile() Profile[source]

Get Signal profile of message sender.

get_sticker() Sticker | None[source]

Return the message’s sticker if there is one.

async mark_read() None[source]

Mark the message as read.

async reply(body: str, attachments: List[Attachment] = [], quote: bool = False, reaction: bool = False, mark_read: bool = True, link_previews: List[LinkPreview] = []) bool[source]

Send a reply to the message.

Parameters:
  • body – The body of the reply

  • attachments – Optional attachments to the message.

  • quote – Indicates if reply is quoting a message.

  • reaction – Indicates if reply is a reaction to message.

  • mark_read – Indicates if message replying to should be marked read.

  • link_previews – Optional link previews for the message.

Returns:

Returns whether reply was sent successfully

Return type:

bool

async typing_started() None[source]

Send a typing started message.

async typing_stopped() None[source]

Send a typing stopped message.