Direct access to Telegram API methods
For every method see Telegram Bot API
Call method
Call method
import tgtb from "@izzqz/tgtb"; const bot_token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"; const bot = tgtb(bot_token); const res = await bot.api.sendMessage({ chat_id: 123456, text: "Hello, world!" }); if (res.ok) { console.log(res.result); // { message_id: 123456 } } else { console.error(res.description); // "Bad Request: chat not found" }
TelegramAPI<F>