-1

I want to use Bold tag example: <b>Hiii</b> to send my messages to user on running of node server.

I am using : npm Tgfancy

Node

const chatId = '-xxxxxx';

const token = '566470572:ffffff';

const bot = new Tgfancy(token, {
    // all options to 'tgfancy' MUST be placed under the
    // 'tgfancy' key, as shown below
    tgfancy: {
        option: "value",
    },
});

bot.sendMessage(parse_mode='HTML', chatId, replyText);

How can I parse HTML with that?

I have my content but its not tagging with bold or any other HTML tags.

My code

var replyText = " Signal #"+coinName+ " has reached 1st target! " +profit+ "% profit \nCurrent Price:" +liveCoinPrice+ "\nDuration: " +difference + "\nNote: Message from live coin high node server";

Here, I want to bold coinName, profit, etc.

Output

enter image description here

Any help would be thankful.

Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132
Tammy
  • 1,122
  • 5
  • 19
  • 50
  • 2
    how do you output your html? How do you handle response from above? Can you provide more details, additional code? – Nikola Kirincic Jul 17 '18 at 10:39
  • 1
    You need to provide a [mcve]. We have no idea what you are doing with this string. – Quentin Jul 17 '18 at 10:41
  • @Quentin I just want to bold those fonts on telegram message. – Tammy Jul 17 '18 at 10:43
  • You might have wanted to lead with the fact you were dealing with telegram. – Quentin Jul 17 '18 at 10:45
  • check my output, – Tammy Jul 17 '18 at 10:45
  • 1
    Duplicate: https://stackoverflow.com/questions/38119481/send-bold-italic-text-on-telegram-bot-with-html – Quentin Jul 17 '18 at 10:45
  • @Quentin . its not worked – Tammy Jul 17 '18 at 10:46
  • @TanmoySarkar — Where's the code where you set the parse mode? Provide a [mcve]. – Quentin Jul 17 '18 at 10:47
  • 1
    _“i tried . its not worked”_ - please realize that this is one of the worst responses you could possibly give, and avoid them in the future. If you already tried something that worked for other people, then you need to show us how exactly you tried to use it if you are still having trouble it. Just saying “did not work” is just BS. – CBroe Jul 17 '18 at 10:50
  • @CBroe sure i will keep it on mind. – Tammy Jul 17 '18 at 10:51
  • @TanmoySarkar This link => https://stackoverflow.com/questions/38119481/send-bold-italic-text-on-telegram-bot-with-html has the answer. – David R Jul 17 '18 at 10:52

1 Answers1

2

This worked for parse_mode = "HTML".

https://github.com/yagop/node-telegram-bot-api/issues/108

var replyText = "Signal #" + coinName.bold() + " has reached 2nd target! " + profit.bold() + "% profit \nCurrent Price: " + liveCoinPrice.bold() + "\nDuration: " + difference.bold();

var option = {
  "parse_mode": "HTML",
};

bot.sendMessage(msg.chat.id, replyText, option);
Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132
Tammy
  • 1,122
  • 5
  • 19
  • 50