Added a warning log for the responsible exception

This commit is contained in:
AlexHTW
2023-04-12 10:53:19 +02:00
parent cc47a18078
commit f045579a3f

View File

@@ -490,7 +490,8 @@ class ChatGPTTelegramBot:
allowed_user_ids = self.config['allowed_user_ids'].split(',') allowed_user_ids = self.config['allowed_user_ids'].split(',')
if str(user_id) not in allowed_user_ids and 'guests' in self.usage: if str(user_id) not in allowed_user_ids and 'guests' in self.usage:
self.usage["guests"].add_chat_tokens(total_tokens, self.config['token_price']) self.usage["guests"].add_chat_tokens(total_tokens, self.config['token_price'])
except: except Exception as e:
logging.warning(f'Failed to add tokens to usage_logs: {str(e)}')
pass pass
except Exception as e: except Exception as e: