node-tele-bot-api
v0.0.11
Published
A lightweight Node.js library for building Telegram bots. Easily manage messages, commands, and events with a simple and intuitive API.
Downloads
8
Maintainers
Readme
A lightweight Node.js library for building Telegram bots. Easily manage messages, commands, and events with a simple and intuitive API.
Features
- Simple API for creating and managing Telegram bots
- Support for handling commands and events
- Flexible and scalable architecture
- Easy to integrate with existing Node.js applications
- Supporting Only Common Type (CJS)
Installation
npm i node-tele-bot-api
🚀 Usage
Here’s a quick example of how to get started:
const { NodeTeleBotAPI } = require("node-tele-bot-api");
// replace the value below with the Telegram token you receive from @BotFather
const BOT_TOKEN = "YOUR_BOT_TOKEN";
const bot = new NodeTeleBotAPI(BOT_TOKEN);
bot.onCommand("start", function (message) {
bot.telegram.sendMessage({
chat_id: message.chat.id,
text: `Hello! <b>I'm</b> a simple bot that responds to /start command with a greeting message.`,
});
});
bot.startBot(() => {
console.log("Bot Started");
});
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
The MIT License (MIT)
Copyright © 2019 Pr0fess0r-99 (Muhammed RT)
This project is licensed under the MIT License. See the LICENSE file for details.