I need to create anonymous messages so that a person can send a question to the developer and he answered it.but I have an error, instead of responding, the bot simply does not send a message to the user
import telebot
bot = telebot.TeleBot('')
developer_chat_id = ''
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, 'Your answer.')
@bot.message_handler(func=lambda message: True)
def ask_developer(message):
if str(message.chat.id) == developer_chat_id:
bot.send_message(developer_chat_id, 'No you can't send a message to yourself')
else:
bot.send_message(developer_chat_id, f'User: {message.text}')
@bot.message_handler(func=lambda message: message.reply_to_message is not None and str(message.reply_to_message.chat.id) == developer_chat_id, content_types=['text'])
def answer_question(message):
bot.send_message(message.reply_to_message.reply_to_message.chat.id, message.text)
bot.polling()
I expected the code to be correct, but instead of answering, the bot writes you can't send a message to yourself