I am creating a bot that is simply sent message to a specific group.
code
import telebot
import time
# BOT_TOKEN
bot = telebot.TeleBot('6332067145:AAElyMP_w69oR9********')
group_id = '-10017112******'
def send_msg():
bot.send_message(group_id, "Hello")
# Start the bot
while True:
send_msg()
time.sleep(60) # Sleep for 60 seconds (1 minute)
I create another bot that catch the msg & display it
code:
import re
import telebot
BOT_TOKEN = '6523213233:AAGzODrpeolUEc*************'
bot = telebot.TeleBot(BOT_TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, "Hello! I'm MsgDetectorBot. I can detect Msg.")
@bot.message_handler(func=lambda message: True)
def detect_messages(message):
bot.reply_to(message, f"You sent: {message.text}")
bot.polling()
The first bot works properly, but the second bot can only find a message if it comes from a real person(real user). I search Google for the answer but can't find it(found but they said that it not possible). I would like to know if it is possible to determine if a message was sent by the bot. Then how?