Net::Async::Slack - support for the https://slack.com APIs with IO::Async
use IO::Async::Loop; use Net::Async::Slack; my $loop = IO::Async::Loop->new; $loop->add( my $gh = Net::Async::Slack->new( token => '...', ) );
This is a basic wrapper for Slack's API. It's an early version, the module API is likely to change somewhat over time.
See the examples/ directory for usage.
examples/
Establishes a connection to the Slack RTM websocket API, and resolves to a Net::Async::Slack::RTM instance.
Send a message to a user or channel.
Supports the following named parameters:
channel - who to send the message to, can be a channel ID or #channel name, or user ID
#channel
text - the message, see https://api.slack.com/docs/message-formatting for details
attachments - more advanced messages, see https://api.slack.com/docs/message-attachments
parse - whether to parse content and convert things like links
and the following named boolean parameters:
link_names - convert @user and #channel to links
@user
unfurl_links - show preview for URLs
unfurl_media - show preview for things that look like media links
as_user - send as user
reply_broadcast - send to all users when replying to a thread
Returns a Future, although the content of the response is subject to change.
Returns the hashref of API endpoints, loading them on first call from the share/endpoints.json file.
share/endpoints.json
Processes the given endpoint as a template, using the named parameters passed to the method.
Our API token.
Returns the HTTP instance used for communicating with the API.
Currently autocreates a Net::Async::HTTP instance.
Issues an HTTP GET request.
Issues an HTTP POST request.
https://metacpan.org/pod/AnyEvent::SlackRTM
https://metacpan.org/pod/Mojo::SlackRTM
https://metacpan.org/pod/Slack::RTM::Bot
https://metacpan.org/pod/WebService::Slack::WebApi
add_child, adopt_future, can_event, children, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, new, notifier_name, parent, remove_child, remove_from_parent
Tom Molesworth <TEAM@cpan.org>
Copyright Tom Molesworth 2016-2017. Licensed under the same terms as Perl itself.
To install Net::Async::Slack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Async::Slack
CPAN shell
perl -MCPAN -e shell install Net::Async::Slack
For more information on module installation, please visit the detailed CPAN module installation guide.