This project is not covered by Drupal’s security advisory policy.
This module utilizes methods from the Slack RTM API to pull messages into your Drupal site.
The modules creates a new non editable entity called slack_rtm_message that stores all the message info. You can set the display settings for it as well. You can choose how to display the data from there.
Setup
- Setup your token on the configuration @ admin/config/services/slackrtm/config
- Go to admin/structure/slack_rtm_message and you can run a batch update to grab all your messages.
- OR you can wait from the cron queue mechanism to kick in. I strongly recommend using a module like Ultimate Cron to make your cron runs more granular.
API
It also comes with a method to call the Slack RTM API method endpoints as well.
To utilize it, in your code do the following:
use Drupal\slack_rtm\SlackRtmApi;
function whatever() {
$slack = new SlackRtmApi();
// This will return an object on success or NULL if it fails
// The API call looks like this in the class:
// callApi($endpoint, array $params = [], $type = 'GET')
// So you can call it like this:
$params['token'] = $slack->getToken('slack_bot_token');
$api = $slack->callAPI('endpoint', $params);
}
You can also extend the class obviously for a more OO approach.
The alpha version are completely usable
I just need to clean up the code, add a couple other features, etc. See beta roadmap
alpha5 Changes
Make sure to visit /admin/config/services/slackrtm/config and re-enter your keys and settings as the module switched from config to states.
Project information
- Project categories: Integrations
- Created by labboy0276 on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
