mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-23 07:35:06 +01:00
Remove Imaging Data from the /stats Command
This commit is contained in:
@@ -100,29 +100,41 @@ class ChatGPTTelegramBot:
|
|||||||
chat_messages, chat_token_length = self.openai.get_conversation_stats(chat_id)
|
chat_messages, chat_token_length = self.openai.get_conversation_stats(chat_id)
|
||||||
remaining_budget = get_remaining_budget(self.config, self.usage, update)
|
remaining_budget = get_remaining_budget(self.config, self.usage, update)
|
||||||
bot_language = self.config['bot_language']
|
bot_language = self.config['bot_language']
|
||||||
|
|
||||||
text_current_conversation = (
|
text_current_conversation = (
|
||||||
f"*{localized_text('stats_conversation', bot_language)[0]}*:\n"
|
f"*{localized_text('stats_conversation', bot_language)[0]}*:\n"
|
||||||
f"{chat_messages} {localized_text('stats_conversation', bot_language)[1]}\n"
|
f"{chat_messages} {localized_text('stats_conversation', bot_language)[1]}\n"
|
||||||
f"{chat_token_length} {localized_text('stats_conversation', bot_language)[2]}\n"
|
f"{chat_token_length} {localized_text('stats_conversation', bot_language)[2]}\n"
|
||||||
f"----------------------------\n"
|
f"----------------------------\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
text_today_images = ""
|
||||||
|
if self.config.get('enable_image_generation', False):
|
||||||
|
text_today_images = f"{images_today} {localized_text('stats_images', bot_language)}\n"
|
||||||
|
|
||||||
text_today = (
|
text_today = (
|
||||||
f"*{localized_text('usage_today', bot_language)}:*\n"
|
f"*{localized_text('usage_today', bot_language)}:*\n"
|
||||||
f"{tokens_today} {localized_text('stats_tokens', bot_language)}\n"
|
f"{tokens_today} {localized_text('stats_tokens', bot_language)}\n"
|
||||||
f"{images_today} {localized_text('stats_images', bot_language)}\n"
|
f"{text_today_images}" # <- Incorporamos la variable que contiene el texto de imágenes
|
||||||
f"{transcribe_minutes_today} {localized_text('stats_transcribe', bot_language)[0]} "
|
f"{transcribe_minutes_today} {localized_text('stats_transcribe', bot_language)[0]} "
|
||||||
f"{transcribe_seconds_today} {localized_text('stats_transcribe', bot_language)[1]}\n"
|
f"{transcribe_seconds_today} {localized_text('stats_transcribe', bot_language)[1]}\n"
|
||||||
f"{localized_text('stats_total', bot_language)}{current_cost['cost_today']:.2f}\n"
|
f"{localized_text('stats_total', bot_language)}{current_cost['cost_today']:.2f}\n"
|
||||||
f"----------------------------\n"
|
f"----------------------------\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
text_month_images = ""
|
||||||
|
if self.config.get('enable_image_generation', False):
|
||||||
|
text_month_images = f"{images_month} {localized_text('stats_images', bot_language)}\n"
|
||||||
|
|
||||||
text_month = (
|
text_month = (
|
||||||
f"*{localized_text('usage_month', bot_language)}:*\n"
|
f"*{localized_text('usage_month', bot_language)}:*\n"
|
||||||
f"{tokens_month} {localized_text('stats_tokens', bot_language)}\n"
|
f"{tokens_month} {localized_text('stats_tokens', bot_language)}\n"
|
||||||
f"{images_month} {localized_text('stats_images', bot_language)}\n"
|
f"{text_month_images}" # <- Incorporamos la variable que contiene el texto de imágenes
|
||||||
f"{transcribe_minutes_month} {localized_text('stats_transcribe', bot_language)[0]} "
|
f"{transcribe_minutes_month} {localized_text('stats_transcribe', bot_language)[0]} "
|
||||||
f"{transcribe_seconds_month} {localized_text('stats_transcribe', bot_language)[1]}\n"
|
f"{transcribe_seconds_month} {localized_text('stats_transcribe', bot_language)[1]}\n"
|
||||||
f"{localized_text('stats_total', bot_language)}{current_cost['cost_month']:.2f}"
|
f"{localized_text('stats_total', bot_language)}{current_cost['cost_month']:.2f}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# text_budget filled with conditional content
|
# text_budget filled with conditional content
|
||||||
text_budget = "\n\n"
|
text_budget = "\n\n"
|
||||||
budget_period = self.config['budget_period']
|
budget_period = self.config['budget_period']
|
||||||
|
|||||||
Reference in New Issue
Block a user