-
Clone the repo:
git clone https://github.com/LeonLiber/tabot.git <folder name> -
Run
php composer.phar install -
Open
localhost/<folder name>in you're browser -
Goto
https://developers.facebook.com/docs/messenger-platform/quickstartand setup you're botTip: Don't forget to add 'Webhooks' product
-
Install NodeJS, then run
sudo npm i localtunnel -g, then runlt --port 80This will return a public URL to you're port 80 (which is the where the bot is)
#Logs /var/log/apache2/error.log
logs.log
#FAQ
-
.htaccess issues?
-
Put it in the root /var/www/
-
nano /etc/apache2/apache2.conf
Change the directive pointing to your public web pages, where the htaccess file resides. Change from AllowOverride None to AllowOverride All
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> -
-
Restart apache
sudo service apache2 restart
-
Bot not getting messages from FB?
Go to https://developers.facebook.com/apps/XXXXXX/messenger/ and make sure that under 'Webooks' the correct page is selected
-
Install/Reinstall LAMP
Remove existing: sudo apt-get purge apache2
-
Change document root
Go to /etc/apache2/sites-enabled
sudo nano 000-default.conf
Update the path to the root folder & save
-
Where is my bot app & page?
#Heorku deployment
-
To get the DB host, run
heroku config --app tabotand take part of theCLEARDB_DATABASE_URLas the base URL -
heroku logs -a tabot -t -
SSH to dyno:
heroku run bash -a tabot
#Database
CREATE TABLE IF NOT EXISTS messages (
id int(11) NOT NULL AUTO_INCREMENT,
message varchar(1024) COLLATE utf8_unicode_ci NOT NULL,
userId text COLLATE utf8_unicode_ci NOT NULL,
created date NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=74 ;