mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-19 13:44:57 +01:00
makes bot reply to quotes of its own messages in a group
This commit is contained in:
@@ -295,8 +295,11 @@ class ChatGPT3TelegramBot:
|
||||
if prompt.startswith(trigger_keyword):
|
||||
prompt = prompt[len(trigger_keyword):].strip()
|
||||
else:
|
||||
logging.warning('Message does not start with trigger keyword, ignoring...')
|
||||
return
|
||||
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:
|
||||
logging.warning('Message does not start with trigger keyword, ignoring...')
|
||||
return
|
||||
|
||||
await context.bot.send_chat_action(chat_id=chat_id, action=constants.ChatAction.TYPING)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user