-
Notifications
You must be signed in to change notification settings - Fork 110
HOW TO INSTALL (English)
#INSTALLATION AND SETUP MANUAL
- Create new bot:
1.1) Install Telegram (https://telegram.org/)
1.2) Add user @BotFather and register new Bot
1.3) Use «/newbot» to create new Bot
1.4) Use «/setcommands» to setup commands list. Commands list looks like:
offline - Go offline online - Go online exit - Quit from system
1.5) Use «/setuserpic» to set user picture
-
Edit configuration in «telegramSiteHelper/tbConfig.php»
2.1) Edit $tbRootDir var, set the path of telegramSiteHelper folder,(something like this «var/www/mysite/telegramSiteHelper»)
2.2) Create a password $tbManagerPassword — managers will use it to login
2.3) Edit $tbAPIToken — paste you API key here
2.4) Edit $dbUse — if you want use SQLite - set it to «sqlite»; if you want use MySQL - set it to «mysql»;
2.5) If you use MySQL, fill hostname, dbname, login and password vars ($mysqlHost, $mysqlDB, $mysqlLogin, $mysqlPassword)
-
Edit your site pages:
3.1) Insert code below and from index.html to your page
3.2) Insert <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> to your site
3.3) Insert <script type="text/javascript" src="iscroll.js"></script> to your site (check valid path)
3.4) Insert <script type="text/javascript" src="chat.js"></script> to your site (check valid path)
3.5) Edit (if you want) and insert to your site (check valid path)
3.6) If you need - translate and localize files
-
Upload everything to your hosting/server/VPS
4.1) «telegramSiteHelper/tbServer.php» should run continuously, because it is a server. Add the cron job with a period of 1 every minute for this script. If the script fails, it will start again for a minute. It will be launched at the same time only one copy of the script.
5) Try!
6) Usage:
6.1) Add your bot to your contact list
6.2) Enter your manager password
6.3) Use command «/offline», «/online», «/exit»
- Localization:
7.1) Copy "en.php" in /telegramSiteHelper/localization and rename it to "myLanguge.php" 7.2) Edit tbConfig.php. Set $tbLanguageFile="myLanguge.php"; 7.3) Restart tbServer by creating file "/telegramSiteHelper/stopserver" (check file owner and chmod: php will try to delete it) and wait 1 minute, while crontab start tbServer.php again.