Types

Common types for signal_bot_framework.

class signal_bot_framework.types.AccountNumber

A Signal account phone number with a + and country code. Actually a str.

alias of str

class signal_bot_framework.types.AccountUUID

A Signal account UUID. Actually a str.

alias of str

class signal_bot_framework.types.GroupId

A Signal group ID. Actually a str of a base-64 encoded identifier.

alias of str

class signal_bot_framework.types.NotificationFrame

Bases: TypedDict

Raw JSON-RPC notification frame (type hint only, will be raw dict).

jsonrpc: Literal['2.0']

JSON-RPC Version. Always 2.0.

method: str

The JSON-RPC method.

params: Any

JSON-RPC method parameters.

id: UnionType[str, int, None]

Notification ID.

class signal_bot_framework.types.ErrorFrame

Bases: TypedDict

Raw JSON-RPC error frame (type hint only, will be raw dict at runtime).

code: int
message: str
data: Any
class signal_bot_framework.types.ResponseFrame

Bases: TypedDict

Raw JSON-RPC response frame (type hint only, will be raw dict at runtime).

jsonrpc: Literal['2.0']
error: ErrorFrame
result: Any
id: UnionType[str, int, None]
class signal_bot_framework.types.Response(frame)

Bases: object

Realized JSON-RPC response.

result: Any
async classmethod from_future_frame(frame)

Create a future Response from a future ResponseFrame.

Parameters:

frame (Future[ResponseFrame]) – The frame to create a response from.

class signal_bot_framework.types.GroupInfoFrame

Bases: TypedDict

Raw signal-cli GroupInfo frame (type hint only, will be raw dict at runtime).

groupId: str
type: Literal['UPDATE', 'DELIVER']
class signal_bot_framework.types.DataMessageFrame

Bases: TypedDict

Raw signal-cli DataMessage frame (type hint only, will be raw dict at runtime).

timestamp: int
message: Optional[str]
expiresInSeconds: int
viewOnce: bool
reaction: Any
quote: Any
payment: Any
mentions: list[Any]
previews: list[Any]
attachments: list[Any]
sticker: Any
remoteDelete: Any
contacts: list[Any]
textStyles: list[Any]
groupInfo: GroupInfoFrame
storyContext: Any
class signal_bot_framework.types.EnvelopeFrame

Bases: TypedDict

Raw signal-cli Envelope frame (type hint only, will be raw dict at runtime).

source: str
sourceNumber: Optional[NewType(AccountNumber, str)]
sourceUuid: NewType(AccountUUID, str)
sourceName: str
sourceDevice: int
timestamp: int
dataMessage: DataMessageFrame
editMessage: Any
storymessage: Any
syncMessage: Any
callMessage: Any
receiptMessage: Any
typingMessage: dict
class signal_bot_framework.types.MentionFrame

Bases: TypedDict

An @mention in a DataMessage.

name: str
number: Optional[NewType(AccountNumber, str)]
uuid: NewType(AccountUUID, str)
start: int
length: int
class signal_bot_framework.types.DataMessage(frame)

Bases: object

A realized DataMessage.

message: Optional[str]
view_once: Optional[bool]
reaction: Optional[Any]
quote: Optional[Any]
payment: Optional[Any]
mentions: Optional[list[MentionFrame]]
previews: Optional[list[Any]]
attachments: Optional[list[Any]]
sticker: Optional[Any]
remote_delete: Optional[Any]
contacts: Optional[list[Any]]
text_styles: Optional[list[Any]]
group_info: Optional[GroupInfoFrame]
story_context: Optional[Any]
timestamp: datetime

The parsed time at which this message was sent.

unix_timestamp: int
sender: Union[NewType(AccountNumber, str), NewType(AccountUUID, str), None]
sender_name: str
sender_uuid: NewType(AccountUUID, str)
expires_in: timedelta