Spaces:
Running
Running
Update akn/Gemini/gemini.py
Browse files- akn/Gemini/gemini.py +0 -44
akn/Gemini/gemini.py
CHANGED
@@ -164,17 +164,6 @@ async def chatbot_talk(client: Client, message: Message):
|
|
164 |
os.remove("chat.txt")
|
165 |
else:
|
166 |
await ai_reply.edit_text(response_reads)
|
167 |
-
user_detail = (
|
168 |
-
f"**Gemini Bot**\n"
|
169 |
-
f"**User Username**: @{message.from_user.username if message.from_user else None}\n"
|
170 |
-
f"**User ID**: `{message.from_user.id}`\n"
|
171 |
-
f"**Chat Title**: `{message.chat.title if message.chat else None}`\n"
|
172 |
-
f"**Chat ID**: `{message.chat.id if message.chat else None}`\n"
|
173 |
-
)
|
174 |
-
response_log = await send_log(user_detail)
|
175 |
-
if response_log is None:
|
176 |
-
LOGS.warning("Error response")
|
177 |
-
LOGS.info(response_log)
|
178 |
backup_chat.append({"role": "model", "parts": [{"text": response_reads}]})
|
179 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
180 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
@@ -236,17 +225,6 @@ async def chatbot_talk(client: Client, message: Message):
|
|
236 |
os.remove("chat.txt")
|
237 |
else:
|
238 |
await ai_reply.edit_text(response.text)
|
239 |
-
user_detail = (
|
240 |
-
f"**Gemini Bot**\n"
|
241 |
-
f"**User Username**: @{message.from_user.username if message.from_user else None}\n"
|
242 |
-
f"**User ID**: `{message.from_user.id}`\n"
|
243 |
-
f"**Chat Title**: `{message.chat.title if message.chat else None}`\n"
|
244 |
-
f"**Chat ID**: `{message.chat.id if message.chat else None}`\n"
|
245 |
-
)
|
246 |
-
response_log = await send_log(user_detail)
|
247 |
-
if response_log is None:
|
248 |
-
LOGS.warning("Error response")
|
249 |
-
LOGS.info(response_log)
|
250 |
backup_chat.append({"role": "model", "parts": [{"text": response.text}]})
|
251 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
252 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
@@ -306,17 +284,6 @@ async def chatbot_talk(client: Client, message: Message):
|
|
306 |
os.remove("chat.txt")
|
307 |
else:
|
308 |
await ai_reply.edit_text(response.text)
|
309 |
-
user_detail = (
|
310 |
-
f"**Gemini Bot**\n"
|
311 |
-
f"**User Username**: @{message.from_user.username if message.from_user else None}\n"
|
312 |
-
f"**User ID**: `{message.from_user.id}`\n"
|
313 |
-
f"**Chat Title**: `{message.chat.title if message.chat else None}`\n"
|
314 |
-
f"**Chat ID**: `{message.chat.id if message.chat else None}`\n"
|
315 |
-
)
|
316 |
-
response_log = await send_log(user_detail)
|
317 |
-
if response_log is None:
|
318 |
-
LOGS.warning("Error response")
|
319 |
-
LOGS.info(response_log)
|
320 |
backup_chat.append({"role": "model", "parts": [{"text": response.text}]})
|
321 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
322 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
@@ -360,17 +327,6 @@ async def chatbot_talk(client: Client, message: Message):
|
|
360 |
os.remove("chat.txt")
|
361 |
else:
|
362 |
await message.reply_text(output)
|
363 |
-
user_detail = (
|
364 |
-
f"**Gemini Bot**\n"
|
365 |
-
f"**User Username**: @{message.from_user.username if message.from_user else None}\n"
|
366 |
-
f"**User ID**: `{message.from_user.id}`\n"
|
367 |
-
f"**Chat Title**: `{message.chat.title if message.chat else None}`\n"
|
368 |
-
f"**Chat ID**: `{message.chat.id if message.chat else None}`\n"
|
369 |
-
)
|
370 |
-
response_log = await send_log(user_detail)
|
371 |
-
if response_log is None:
|
372 |
-
LOGS.warning("Error response")
|
373 |
-
LOGS.info(response_log)
|
374 |
backup_chat.append({"role": "model", "parts": [{"text": output}]})
|
375 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
376 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
|
|
164 |
os.remove("chat.txt")
|
165 |
else:
|
166 |
await ai_reply.edit_text(response_reads)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
backup_chat.append({"role": "model", "parts": [{"text": response_reads}]})
|
168 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
169 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
|
|
225 |
os.remove("chat.txt")
|
226 |
else:
|
227 |
await ai_reply.edit_text(response.text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
backup_chat.append({"role": "model", "parts": [{"text": response.text}]})
|
229 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
230 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
|
|
284 |
os.remove("chat.txt")
|
285 |
else:
|
286 |
await ai_reply.edit_text(response.text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
backup_chat.append({"role": "model", "parts": [{"text": response.text}]})
|
288 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
289 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|
|
|
327 |
os.remove("chat.txt")
|
328 |
else:
|
329 |
await message.reply_text(output)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
backup_chat.append({"role": "model", "parts": [{"text": output}]})
|
331 |
await db._update_chatbot_chat_in_db(message.from_user.id, backup_chat)
|
332 |
await client.send_chat_action(message.chat.id, enums.ChatAction.CANCEL)
|