Skip to content

Commit

Permalink
add disclaimer to telegram answer
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-volz committed Sep 4, 2023
1 parent 5271fd9 commit 7e6df09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bots/jellychatapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

class JellyChatAPI:

DISCLAIMER = "Disclaimer:\nThis message is generated by JellyChat, an defichain specific chatbot. It's not yet " \
"perfect, so take every message with a pinch of salt!🧂"

@staticmethod
def create_user_token(identification: Any) -> str:
return hashlib.sha256((str(identification)).encode("utf-8")).hexdigest()
Expand Down
4 changes: 4 additions & 0 deletions bots/telegram/telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ async def handler(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
logging.info(logging_question)
answer: str = self.jellyChatAPI.user_message(userToken, question, JellyChatTelegramBot.APPLICATION)

# Add disclaimer message
if JellyChatAPI.DISCLAIMER:
answer += "\n\n" + JellyChatAPI.DISCLAIMER

logging.info(f"Answer: Chat ID: {chatId}, Chat Type: {chatType}, Answer: \n{answer}")
await update.message.reply_text(answer)

Expand Down

0 comments on commit 7e6df09

Please sign in to comment.