Skip to content

Commit

Permalink
Merge pull request #21 from ApeWorX/feat/ninjagod/port_fix
Browse files Browse the repository at this point in the history
fix: error handler
  • Loading branch information
Ninjagod1251 authored Apr 15, 2024
2 parents 2e2bbe7 + d97c4b7 commit fcb9f89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from telegram.ext import Updater, CommandHandler, CallbackContext, MessageHandler, Filters
import requests
import anthropic
import logging


# Load your OpenAI API key and Telegram token from environment variables or direct string assignment
Expand Down Expand Up @@ -226,7 +227,10 @@ def handle_message(update: Update, context: CallbackContext) -> None:
groups[group_id]['messages_today'] += 1
save_data()
except Exception as e:
context.logger.error(f"Claude Error: {e}")
error_message = "f'Error message:' {e}"
update.message.reply_text(error_message)

print(error_message)



Expand Down

0 comments on commit fcb9f89

Please sign in to comment.