Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erickgbr/telegram_chatbot_follower_campaign
Boliler plate chatbot telegram
https://github.com/erickgbr/telegram_chatbot_follower_campaign
Last synced: 10 days ago
JSON representation
Boliler plate chatbot telegram
- Host: GitHub
- URL: https://github.com/erickgbr/telegram_chatbot_follower_campaign
- Owner: ErickGBR
- License: mit
- Created: 2023-10-08T18:28:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-16T01:50:43.000Z (about 1 year ago)
- Last Synced: 2023-10-16T21:15:07.211Z (about 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# telegram_chatbot_follower_campaign
## Introduction
The **telegram_cratbot_follower_campaign** project is a boilerplate chatbot for Telegram, built using the `node-telegram-bot-api` library. This README will guide you through creating a Telegram chatbot, and it assumes you have already generated an API token using BotFather on Telegram.
## Getting Started
### Prerequisites
Before you can start using this project, make sure you have the following:
- Node.js and npm (Node Package Manager) installed on your system.
- A Telegram account and a bot API token obtained from BotFather.### Installation
1. Clone this repository to your local machine.
```bash
git clone https://github.com/yourusername/telegram_cratbot_follower_campaign.git
cd telegram_cratbot_follower_campaign
```2. Install the required dependencies by running the following command:
```bash
npm install
```### Configuration
Create a `.env` file in the project root directory and add your Telegram bot API token as follows:
```env
TELEGRAM_BOT_TOKEN=your_bot_api_token_here
```### Basic Chatbot Usage
The core functionality of this project is to create a Telegram chatbot with buttons that users can interact with. Here's an example of how to create a chatbot that displays a menu with buttons:
```javascript
const TelegramBot = require('node-telegram-bot-api');// Create a new instance of the TelegramBot class with your API token
const bot = new TelegramBot(process.env.TELEGRAM_BOT_TOKEN, { polling: true });// Event listener for incoming messages
bot.on('message', (msg) => {
const chatId = msg.chat.id;const buttons = {
reply_markup: {
inline_keyboard: [
[
{ text: 'Facebook', callback_data: '1' },
{ text: 'Instagram', callback_data: '2' }
],
[
{ text: 'Youtube', callback_data: '3' }
]
]
}
};bot.sendMessage(chatId, 'π€βΊοΈ Welcome, in this chatbot you can acquire Likes according to your publication or video that you want to boost!', buttons);
});
```This code sets up a basic chatbot that listens for incoming messages and responds with a menu containing buttons. Users can click these buttons to interact with the chatbot.
## Usage
To run your Telegram chatbot, execute the following command:
```bash
node your_bot_script.js
```Replace `your_bot_script.js` with the name of your bot script file.
## Conclusion
The **telegram_cratbot_follower_campaign** project provides you with a boilerplate for creating a Telegram chatbot using the `node-telegram-bot-api` library. You can extend and customize the bot's functionality to meet your specific needs and create engaging interactions with Telegram users.
If you have any questions or encounter any issues, feel free to refer to the project's GitHub repository for further assistance.
---
Make sure to replace `"your_bot_api_token_here"` with your actual Telegram bot API token and provide any additional details or documentation specific to your project as needed.