This guide will walk you through setting up and running this Telegram bot on your own machine.
-
Node.js (version 14.x or higher)
-
npm (usually comes with Node.js)
-
A Telegram Account
First, clone the repository to your local machine and install the necessary dependencies.
# Clone the repository
git clone https://github.com/1dev-hridoy/FreeFire-Info-TelegramBot.git
# Navigate to the project directory
cd FreeFire-Info-TelegramBot
# Install dependencies
npm install
To run the bot, you need a unique token from Telegram.
-
Open Telegram and search for the
BotFatheruser (he's the one with the blue checkmark). -
Start a chat with
BotFatherand send the/newbotcommand. -
Follow the prompts to choose a name and a username for your bot. The username must end in
bot(e.g.,MyTestBot). -
Once you're done,
BotFatherwill give you a long token. It will look something like1234567890:ABCdEfGhIjKlMnOpQrStUvWxYz. -
Keep this token safe and private!
All the bot's settings are in the config.json file. You need to edit this file with your own information.
-
Open
config.jsonin a text editor. -
Fill in the following fields:
-
ownerName: Your name or nickname. -
ownerUid: Your numeric Telegram User ID. -
botToken: The token you got fromBotFatherin the previous step. -
baseUrl: The base URL for the API the bot uses. -
botPrefix: The command prefix (e.g.,/or!). -
allowedGroupId: The numeric ID of the Telegram group where the bot is allowed to work. -
allowedGroupLink: The public link to the allowed group. -
verificationChannelUsername: The@usernameof the channel users must join. -
verificationChannelLink: The public link to that channel.
Example config.json:
{
"ownerName": "1dev-hridoy",
"ownerUid": 123456789,
"botToken": "YOUR_BOT_TOKEN",
"baseUrl": "https://hridoy-ff-1.onrender.com/api",
"botPrefix": "/",
"allowedGroupId": -1002528061649,
"allowedGroupLink": "https://t.me/nexalo",
"verificationChannelUsername": "@bdnoobradeveloper",
"verificationChannelLink": "https://t.me/bdnoobradeveloper"
}
Once you have completed the configuration, you can start the bot.
node bot.js
If everything is set up correctly, you will see a confirmation message in your console, and your bot will be online.
For instructions on how to host this bot for free 24/7, please see the deployment guides in the docs directory:
For support, suggestions, or issues, feel free to reach out:
-
Developer: 1dev-hridoy
-
Telegram Group: Join Here
-
Telegram Channel: @bdnoobradeveloper