Skip to content

Commit

Permalink
Display content within parenthesis with italics
Browse files Browse the repository at this point in the history
  • Loading branch information
njbbaer committed Aug 13, 2024
1 parent faa2162 commit 06ddf85
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/telegram/telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
import re
import textwrap

from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, filters
# fmt: off
from telegram.ext import (ApplicationBuilder, CommandHandler, MessageHandler,
filters)

from ..simulacrum import Simulacrum
from ..telegram.filters import StaleMessageFilter
from ..telegram.message_handler import message_handler

# fmt: on


logger = logging.getLogger("telegram_bot")
logging.basicConfig(level=logging.ERROR)

Expand Down Expand Up @@ -149,7 +154,7 @@ async def do_nothing(self, *_):

async def _chat(self, ctx, user_message, image_url=None):
response = await self.sim.chat(user_message, ctx.user_name, image_url)
response = response.translate(str.maketrans("*_", "_*"))
response = response.replace("(", "_(").replace(")", ")_")
await ctx.send_message(response)
await self._warn_cost(ctx)

Expand Down

0 comments on commit 06ddf85

Please sign in to comment.