Skip to content

Commit

Permalink
add text styling support
Browse files Browse the repository at this point in the history
  • Loading branch information
mariopaolo committed Dec 28, 2023
1 parent 71e09a1 commit ba10da8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions signalbot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def send(
quote_message: str = None,
quote_timestamp: str = None,
mentions: list = None,
text_mode: str = None,
) -> aiohttp.ClientResponse:
uri = self._send_rest_uri()
if base64_attachments is None:
Expand All @@ -56,6 +57,8 @@ async def send(
payload["quote_timestamp"] = quote_timestamp
if mentions:
payload["mentions"] = mentions
if text_mode:
payload["text_mode"] = text_mode

try:
async with aiohttp.ClientSession() as session:
Expand Down
2 changes: 2 additions & 0 deletions signalbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ async def send(
quote_message: str = None,
quote_timestamp: str = None,
mentions: list = None,
text_mode: str = None,
listen: bool = False,
) -> int:
receiver = self._resolve_receiver(receiver)
Expand All @@ -193,6 +194,7 @@ async def send(
quote_message=quote_message,
quote_timestamp=quote_timestamp,
mentions=mentions,
text_mode=text_mode
)
resp_payload = await resp.json()
timestamp = resp_payload["timestamp"]
Expand Down
4 changes: 4 additions & 0 deletions signalbot/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ async def send(
text: str,
base64_attachments: list = None,
mentions: list = None,
text_mode: str = None,
):
return await self.bot.send(
self.message.recipient(),
text,
base64_attachments=base64_attachments,
mentions=mentions,
text_mode=text_mode,
)

async def reply(
self,
text: str,
base64_attachments: list = None,
mentions: list = None,
text_mode: str = None,
):
return await self.bot.send(
self.message.recipient(),
Expand All @@ -35,6 +38,7 @@ async def reply(
quote_message=self.message.text,
quote_timestamp=self.message.timestamp,
mentions=mentions,
text_mode=text_mode,
)

async def react(self, emoji: str):
Expand Down

0 comments on commit ba10da8

Please sign in to comment.