skip to Main Content

Due to a lack of knowledge, I encountered an issue on the TelebotCreator website. I created a simple bot, but I can’t forward messages if they contain one or more photos or videos. Messages without media are forwarded without any problems, but when media is attached, the message fails to send.

I know there are experienced people here; could you help me solve this problem?

    GROUP_ID = "*******"
if msg:
bot.forwardMessage(GROUP_ID, message.chat.id, message.message_id)

P.S. Guys, please, no insults…

2

Answers


  1. You can send message with media like .gif file.

              await bot.sendAnimation(chatId, defaultIMG.file_id, {
                duration: defaultIMG.duration || 2,
                width: defaultIMG.width || 640,
                height: defaultIMG.height || 640,
                thumb: defaultIMG.thumb.file_id,
                caption: strBotDM, // Add the caption here
                parse_mode: "HTML",
              });
    

    Please check this github repo.
    https://github.com/Any-bot/D2T-msg-forward

    Also https://dev.to/plzbugmenot/building-a-discord-to-telegram-token-address-forwarder-8m

    I wanna hear from you.

    Thank you.

    Login or Signup to reply.
  2. If you want to send photo, you can use this codebase.

    api.sendPhoto({
        chat_id : message.chat.id,
        caption: 'This is my test image',
        photo: 'image.jpeg'//replace your image url here
    })
    .then(function(data)
    {
        console.log(data);
    });
    

    Also here.

       _img = url of Image;
        // console.log("photo", _img);
    
        await bot.sendPhoto(channel, _img, {
          caption: Content,
          parse_mode: "HTML",
        });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search