PHP code example of voryx / slack-wamp
1. Go to this page and download the library: Download voryx/slack-wamp library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
voryx / slack-wamp example snippets
en = 'your_slack_token';
$botToken = 'your_slack_token_with_rtm:stream';
$wamp = new \Rx\Thruway\Client('wss://localhost:9090', 'realm1');
(new \SlackWamp\APIBridge($wamp, $token))->subscribe();
(new \SlackWamp\RealTimeBridge($wamp, $botToken))->subscribe();
$wamp->call("users.setpresence", [], ["presence" => "away"])->subscribe(function ($res) {
print_r($res[0]);
});