pythonbotstelegrampy-telegram-bot-api

How forward a message without showing sender's name in pyTelegramBotAPI?


def send_client(message):
    bot.send_message(client_id, f'<b>Someone sent you a message. This is what they said:</b>',
                 parse_mode='html')
    bot.forward_message(client, message.chat.id, message.message_id)
    bot.send_message(message.chat.id, '<b>Message is sent. Thank you for using me!</b>', parse_mode='html')

But it forwards a message without hiding a sender's name Shows my name

I wanted to make a bot that would anonymously forward a message from one person to another. But doing it with send_message would be a little bit problematic, if someone wants to send a photo, or music for example.


Solution

  • Just use copy_message() instead of forward_message(). More about in the documentation.