Update chatbot/plugins/chat.py
Browse files- chatbot/plugins/chat.py +11 -0
chatbot/plugins/chat.py
CHANGED
@@ -118,6 +118,17 @@ async def chatbot_talk(client: Client, message: Message):
|
|
118 |
else:
|
119 |
await message.reply_text(output)
|
120 |
backup_chat.append({"role": "assistant", "content": output})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
await db._update_openai_chat_in_db(message.from_user.id, backup_chat)
|
122 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
123 |
return
|
|
|
118 |
else:
|
119 |
await message.reply_text(output)
|
120 |
backup_chat.append({"role": "assistant", "content": output})
|
121 |
+
user_detail = (
|
122 |
+
f"**Akeno GPT Bot**\n"
|
123 |
+
f"**User Username**: @{message.from_user.username if message.from_user else None}\n"
|
124 |
+
f"**User ID**: `{message.from_user.id}`\n"
|
125 |
+
f"**Chat Title**: `{message.chat.title if message.chat else None}`\n"
|
126 |
+
f"**Chat ID**: `{message.chat.id if message.chat else None}`\n"
|
127 |
+
)
|
128 |
+
response_log = send_log(user_detail)
|
129 |
+
if response_log is None:
|
130 |
+
LOGS.warning("Error response")
|
131 |
+
LOGS.info(response_log)
|
132 |
await db._update_openai_chat_in_db(message.from_user.id, backup_chat)
|
133 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
134 |
return
|