Skip to content

pluzels/Telegraf-Telegram-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegraf-Telegram-Bot

Welcome to the Telegraf-Telegram-Bot repository! This project provides a framework for building Telegram bots using Telegraf.js, a modern, flexible, and lightweight library for interacting with the Telegram Bot API.

Features

  • Full Telegram Bot API support: Easily access all features of the Telegram Bot API.
  • Middleware architecture: Handle updates efficiently with powerful middleware.
  • Extensive plugins: Integrate with various services and platforms using Telegraf plugins.
  • TypeScript support: Write your bots in TypeScript for enhanced type safety.
  • Easy deployment: Deploy your bots to platforms like AWS Lambda, Firebase, and more.

Installation

To get started with Telegraf-Telegram-Bot, you need to have Node.js installed. Then, install the required dependencies:

npm install telegraf

Or using Yarn:

yarn add telegraf

Getting Started

Here’s a simple example to get your bot up and running:

const { Telegraf } = require('telegraf');

const bot = new Telegraf('YOUR_BOT_TOKEN');
bot.start((ctx) => ctx.reply('Welcome!'));
bot.help((ctx) => ctx.reply('Send me a command!'));
bot.on('text', (ctx) => ctx.reply('Hello World!'));

bot.launch();

Replace YOUR_BOT_TOKEN with the token you get from BotFather.

Usage

Telegraf-Telegram-Bot allows you to create bots that can handle various types of messages, including text, stickers, and commands. Here are some of the things you can do:

  • Text Messages: Respond to text messages from users.
  • Commands: Create custom commands for your bot.
  • Event Handling: Handle different events such as joining a chat or receiving media files.

Advanced Configuration

You can also configure webhooks, handle errors gracefully, and extend your bot with custom middleware. For more advanced usage, please refer to the Telegraf documentation.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

Thanks to the developers of Telegraf.js for creating an excellent library for building Telegram bots.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors