Closed vaibhav-kaushal closed 7 years ago
Hello,
You have to create a bot.php file with the following content :
<?php
require 'vendor/autoload.php';
use PhpSlackBot\Bot;
$bot = new Bot();
$bot->setToken('xoxb-**************'); // Replace token
$bot->loadInternalCommands();
$bot->run();
Then run php bot.php
from the command line (terminal).
Inside Slack, the bot should turn online (green dot).
Direct message him by typing ping, the bot should answer "pong".
Please let me know if it works.
This worked. Few suggestions:
php bot.php &
. And many thanks for this library. You can close the issue if you want, but I really recommend you to update the README; will help other newcomers to this repo who are new to Slack's APIs.
You're welcome. I updated the documentation to explain how to run the bot.
Hello @jclg
I have installed this library into my application (using composer) but I do not know where to go now! I have replaced the token given to me by Slack (a bot token). I am not sure how to make the app listen for incoming connections.
Sorry if that sounds like a newbie question.