Hi.
I want to send HTNL formatted message to Telegram channel.
Why am I getting this error? Am I doing this right? Thanks.
Hi @dpenetration24,
It seems like you’re trying to send an HTML formatted message to a Telegram channel and encountering an error. However, without specific details about the error message you’re receiving or the code you’re using to send the message, it’s challenging to provide a precise solution.
To send HTML formatted messages to a Telegram channel, you need to ensure that you’re using the sendMessage
method of the Telegram Bot API and specifying the parse_mode
parameter as HTML
. Here’s a general example of how you might structure your request:
import { axios } from "@pipedream/platform";
export default defineComponent({
props: {
telegram_bot: {
type: "app",
app: "telegram_bot",
},
},
async run({ steps, $ }) {
return await axios($, {
method: "POST",
url: `https://api.telegram.org/bot${this.telegram_bot.$auth.token}/sendMessage`,
data: {
chat_id: "@your_channel_username",
text: "<b>bold</b>, <i>italic</i>, <a href='http://www.example.com/'>inline URL</a>",
parse_mode: "HTML",
},
});
},
});
Please replace @your_channel_username
with your actual Telegram channel username and ensure that your bot is an administrator of the channel.
If you’re still encountering an error, could you please provide more details about the error message or the code you’re using? This information will help in diagnosing the issue more accurately.
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double-check my answers and code! Learn how to build your own.
Thank you, bot.
But is there a way to do this without coding?