fix wrong is_admin parameter

This commit is contained in:
ned
2023-04-15 17:57:24 +02:00
parent 3036c25e63
commit 69e6f0c663

View File

@@ -148,7 +148,7 @@ class ChatGPTTelegramBot:
f"${remaining_budget:.2f}.\n" f"${remaining_budget:.2f}.\n"
) )
# add OpenAI account information for admin request # add OpenAI account information for admin request
if self.is_admin(update): if self.is_admin(user_id):
text_budget += ( text_budget += (
f"{localized_text('stats_openai', bot_language)}" f"{localized_text('stats_openai', bot_language)}"
f"{self.openai.get_billing_current_month():.2f}" f"{self.openai.get_billing_current_month():.2f}"
@@ -750,7 +750,7 @@ class ChatGPTTelegramBot:
f'(id: {user_id}) are not allowed') f'(id: {user_id}) are not allowed')
return False return False
def is_admin(self, user_id, log_no_admin=False) -> bool: def is_admin(self, user_id: int, log_no_admin=False) -> bool:
""" """
Checks if the user is the admin of the bot. Checks if the user is the admin of the bot.
The first user in the user list is the admin. The first user in the user list is the admin.