Skip to content

mi1sh/telegram-bot-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Telegram Bot Template 🤖

This template will allow you to quick launch your own Telegram bot

CLICK TO VIEW BUILT WITH LICENSE

❔About

✔️ Ready-made bot functions:

  • A system of suggestions and messages from users, this is suitable if you are the administrator of a telegram channel;
  • The button to show the main command menu is always located in the lower keyboard for user convenience
  • List of social networks;
  • Other custom commands, such as playlist, about or channel

You can easily customize the responses from the bot by changing the text in the files in the messages directory The same goes for commands, you can edit them by changing files in the commands directory


If you want to deploy your bot remotely using third-party services, use the bot template from the for_deployment branch

🛠️ Built With

  • TypeScript - For enhanced code quality and maintainability
  • Node.js - JavaScript runtime environment
  • Telegraf - Node.js Telegram Bot API framework
  • ts-node - TypeScript execution and REPL for node.js.
  • dotenv - Environment variable management

📀 Getting Started

To run your bot locally with telegram-bot-template, follow these steps:

  1. Clone the repository:
git clone https://github.com/mi1sh/telegram-bot-template.git
  1. Navigate to the project directory:
cd telegram-bot-template
  1. Install dependencies:

    Using npm:

    npm install

    Using yarn:

    yarn install
  2. Go to BotFather, create new bot and copy your bot token.

  3. After that, go to getMyID_bot (for example) and get your Telegram User ID.

  4. Create an .env file in the root of your project or use the ready-made .env.example template. The file must contain the BOT_TOKEN and CHAT_ID variables. Paste your token and id into variables:

  BOT_TOKEN=your_bot_token
  CHAT_ID=your_telegram_id
  1. Run your bot locally:

    Using npm:

    npm run start

    Using yarn:

    yarn start

🟢 That's it! You will see the message Bot is running in the console if everything went well.

🙏 Contributing

Contributions to telegram-bot-template are welcome. If you have a feature request or bug report, please open an issue on the GitHub repository. If you'd like to contribute code, please submit a pull request.

©️ License

telegram-bot-template is open-source software licensed under the MIT License. See the LICENSE file for more details.

Releases

No releases published

Packages

 
 
 

Contributors