Context
Context ¶
Context is a helper class that provides methods to reply, edit, react, etc. to a message. This is useful to avoid having to pass the recipient and other arguments to the bot's methods manually.
Source code in src/signalbot/context.py
19 20 21 | |
edit
async
¶
edit(
text: str,
edit_timestamp: int,
*,
base64_attachments: list[str] | None = None,
link_preview: LinkPreview | None = None,
mentions: list[dict[str, Any]] | None = None,
text_mode: str | None = None,
view_once: bool = False,
) -> int
Same as signalbot.SignalBot.send() but with the recipient and timestamp set to the message's.
Source code in src/signalbot/context.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
react
async
¶
react(emoji: str) -> None
Same as signalbot.SignalBot.react() but with the recipient set to the message's recipient.
Source code in src/signalbot/context.py
103 104 105 106 107 | |
receipt
async
¶
receipt(receipt_type: Literal['read', 'viewed']) -> None
Same as signalbot.SignalBot.receipt() but with the recipient set to the message's recipient.
Source code in src/signalbot/context.py
109 110 111 112 113 | |
remote_delete
async
¶
Same as signalbot.SignalBot.remote_delete() but with the recipient and timestamp set to the message's.
Source code in src/signalbot/context.py
127 128 129 130 131 132 133 | |
reply
async
¶
reply(
text: str,
*,
base64_attachments: list[str] | None = None,
link_preview: LinkPreview | None = None,
mentions: list[dict[str, Any]] | None = None,
text_mode: str | None = None,
view_once: bool = False,
) -> int
Same as signalbot.SignalBot.send() but with the quote arguments set to the message's.
Source code in src/signalbot/context.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
send
async
¶
send(
text: str,
*,
base64_attachments: list[str] | None = None,
link_preview: LinkPreview | None = None,
mentions: list[dict[str, Any]] | None = None,
text_mode: str | None = None,
view_once: bool = False,
) -> int
Same as signalbot.SignalBot.send() but with the recipient set to the message's recipient.
Source code in src/signalbot/context.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
start_typing
async
¶
start_typing() -> None
Same as signalbot.SignalBot.start_typing() but with the recipient set to the message's recipient.
Source code in src/signalbot/context.py
115 116 117 118 119 | |
stop_typing
async
¶
stop_typing() -> None
Same as signalbot.SignalBot.stop_typing() but with the recipient set to the message's recipient.
Source code in src/signalbot/context.py
121 122 123 124 125 | |