mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-20 06:05:12 +01:00
(fix) Passing context
This commit is contained in:
@@ -370,7 +370,14 @@ class ChatGPTTelegramBot:
|
||||
|
||||
if is_group_chat(update):
|
||||
trigger_keyword = self.config['group_trigger_keyword']
|
||||
if prompt.lower().startswith(trigger_keyword.lower()):
|
||||
|
||||
raw_text = update.message.text.lower()
|
||||
prompt_lower = prompt.lower()
|
||||
|
||||
if raw_text.startswith('/chat') or prompt_lower.startswith(trigger_keyword):
|
||||
if not prompt_lower.startswith(trigger_keyword):
|
||||
prompt = f'{trigger_keyword} {prompt}'
|
||||
|
||||
prompt = prompt[len(trigger_keyword):].strip()
|
||||
|
||||
if update.message.reply_to_message and \
|
||||
|
||||
Reference in New Issue
Block a user