- PHP >= 7.4
- MySQL
- Download from repository
git clone https://github.com/iCoderNet/php-bot-template - Go into the 'php-bot-template' folder
cd php-bot-template
1. Connect to MySQL
mysql -u root -p
2. Create a New User
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
3. Create a New Database
CREATE DATABASE newdatabase;
4. Grant Privileges
GRANT ALL PRIVILEGES ON newdatabase.* TO 'newuser'@'localhost';
5. Flush Privileges
FLUSH PRIVILEGES;
6. Exit MySQL
EXIT;
- Open the
env.phpfile inside theconfigfolder - Put your bot token from @BotFather in the
API_TOKENvariable - Put your bot username from @BotFather in the
BOT_USERNAMEvariable - Add your Telegram profile ID number to the
ADMINSarray - In the variables
DB_HOST,DB_USER,DB_PASSandDB_NAME, put the username and password of the MySQL user created above, followed by the name of the attached database
Webhook the index.php file in the main (./) folder