allow disabling image generation and transcriptions (#129)

This commit is contained in:
ned
2023-04-01 10:45:52 +02:00
parent 5062280140
commit 7cba39d1f9
3 changed files with 6 additions and 2 deletions

View File

@@ -173,7 +173,7 @@ class ChatGPTTelegramBot:
"""
Generates an image for the given prompt using DALL·E APIs
"""
if not await self.check_allowed_and_within_budget(update, context):
if not self.config['enable_image_generation'] or not await self.check_allowed_and_within_budget(update, context):
return
chat_id = update.effective_chat.id
@@ -215,7 +215,7 @@ class ChatGPTTelegramBot:
"""
Transcribe audio messages.
"""
if not await self.check_allowed_and_within_budget(update, context):
if not self.config['enable_transcription'] or not await self.check_allowed_and_within_budget(update, context):
return
if self.is_group_chat(update) and self.config['ignore_group_transcriptions']: