Skip to main content

🎥 How to Create a Telegram Bot with QuickAlerts

Updated on
Aug 4, 2023

1 min read

In this video, we will create a Telegram bot to get real-time blockchain notifications in Telegram with the help of Node.js and QuickAlerts.
Subscribe to our YouTube channel for more videos!

Following is the code sample shown in the video. You can also access the file on GitHub.

const express = require("express");
const TelegramBot = require("node-telegram-bot-api");

const {TOKEN, PORT} = process.env;

const bot = new TelegramBot(TOKEN);

const app = express();

// We are receiving updates at the route below!'/webhook', async (req, res) => {
const webhook = req.body;
const from = webhook[0].from;
const to = webhook[0].to;
const token_id = Number.parseInt(webhook[0].logs[0].topics[3],16);
const tx_hash = webhook[0].logs[0].transactionHash;


const chatId = <TELEGRAM_CHANNEL_ID>;

// Sends text to the above chatID
`🔔Bomber Man # ${token_id} transferred🔔\n\n From: ${from}\n\n To: ${to}\n${tx_hash}`


// Start Express Server
app.listen(PORT, () => {
console.log(`Express server is listening`);

We ❤️ Feedback!

Let us know if you have any feedback or requests for new topics. We'd love to hear from you.

Share this guide