mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-22 07:04:59 +01:00
Merge pull request #99 from kamil-malinski/main
makes bot reply to quotes of its own messages in a group
This commit is contained in:
@@ -301,6 +301,9 @@ class ChatGPT3TelegramBot:
|
|||||||
trigger_keyword = self.config['group_trigger_keyword']
|
trigger_keyword = self.config['group_trigger_keyword']
|
||||||
if prompt.startswith(trigger_keyword):
|
if prompt.startswith(trigger_keyword):
|
||||||
prompt = prompt[len(trigger_keyword):].strip()
|
prompt = prompt[len(trigger_keyword):].strip()
|
||||||
|
else:
|
||||||
|
if update.message.reply_to_message and update.message.reply_to_message.from_user.id == context.bot.id:
|
||||||
|
logging.info('Message is a reply to the bot, allowing...')
|
||||||
else:
|
else:
|
||||||
logging.warning('Message does not start with trigger keyword, ignoring...')
|
logging.warning('Message does not start with trigger keyword, ignoring...')
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user