=encoding utf8

=for comment POD_DERIVED_INDEX_GENERATED
The following documentation is automatically generated.  Please do not edit
this file, but rather the original, inline with Net::Async::Slack
at lib/Net/Async/Slack.pm
(on the system that originally ran this).
If you do edit this file, and don't want your changes to be removed, make
sure you change the first line.

=cut

=head1 NAME

Net::Async::Slack - support for the L<https://slack.com> APIs with L<IO::Async>

=head1 SYNOPSIS

 use IO::Async::Loop;
 use Net::Async::Slack;
 my $loop = IO::Async::Loop->new;
 $loop->add(
  my $slack = Net::Async::Slack->new(
   token => '...',
  )
 );

=head1 DESCRIPTION

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 C<examples/> directory for usage.

=head1 METHODS

=head2 rtm

Establishes a connection to the Slack RTM websocket API, and
resolves to a L<Net::Async::Slack::RTM> instance.

=head2 send_message

Send a message to a user or channel.

Supports the following named parameters:

=over 4

=item * channel - who to send the message to, can be a channel ID or C<#channel> name, or user ID

=item * text - the message, see L<https://api.slack.com/docs/message-formatting> for details

=item * attachments - more advanced messages, see L<https://api.slack.com/docs/message-attachments>

=item * parse - whether to parse content and convert things like links

=back

and the following named boolean parameters:

=over 4

=item * link_names - convert C<@user> and C<#channel> to links

=item * unfurl_links - show preview for URLs

=item * unfurl_media - show preview for things that look like media links

=item * as_user - send as user

=item * reply_broadcast - send to all users when replying to a thread

=back

Returns a L<Future>, although the content of the response is subject to change.

=head2 conversations_info

Provide information about a channel.

Takes the following named parameters:

=over 4

=item * C<channel> - the channel ID to look up

=back

and returns a L<Future> which will resolve to a hashref containing
C<< { channel => { name => '...' } } >>.

=head2 join_channel

Attempt to join the given channel.

Takes the following named parameters:

=over 4

=item * C<channel> - the channel ID or name to join

=back

=head1 METHODS - Internal

=head2 endpoints

Returns the hashref of API endpoints, loading them on first call from the C<share/endpoints.json> file.

=head2 endpoint

Processes the given endpoint as a template, using the named parameters
passed to the method.

=head2 oauth_request

=head2 token

API token.

=head2 http

Returns the HTTP instance used for communicating with the API.

Currently autocreates a L<Net::Async::HTTP> instance.

=head2 http_get

Issues an HTTP GET request.

=head2 http_post

Issues an HTTP POST request.

=head1 SEE ALSO

=over 4

=item * L<AnyEvent::SlackRTM> - low-level API wrapper around RTM

=item * L<Mojo::SlackRTM> - another RTM-specific wrapper, this time based on Mojolicious

=item * L<Slack::RTM::Bot> - more RTM support, this time via LWP and a subprocess/thread for handling the websocket part

=item * L<WebService::Slack::WebApi> - Furl-based wrapper around the REST API

=item * L<AnyEvent::SlackBot> - another AnyEvent RTM implementation

=back

=head1 INHERITED METHODS

=over 4

=item L<IO::Async::Notifier>

L<add_child|IO::Async::Notifier/add_child>, L<adopt_future|IO::Async::Notifier/adopt_future>, L<adopted_futures|IO::Async::Notifier/adopted_futures>, L<can_event|IO::Async::Notifier/can_event>, L<children|IO::Async::Notifier/children>, L<configure_unknown|IO::Async::Notifier/configure_unknown>, L<debug_printf|IO::Async::Notifier/debug_printf>, L<get_loop|IO::Async::Notifier/get_loop>, L<invoke_error|IO::Async::Notifier/invoke_error>, L<invoke_event|IO::Async::Notifier/invoke_event>, L<loop|IO::Async::Notifier/loop>, L<make_event_cb|IO::Async::Notifier/make_event_cb>, L<maybe_invoke_event|IO::Async::Notifier/maybe_invoke_event>, L<maybe_make_event_cb|IO::Async::Notifier/maybe_make_event_cb>, L<new|IO::Async::Notifier/new>, L<notifier_name|IO::Async::Notifier/notifier_name>, L<parent|IO::Async::Notifier/parent>, L<remove_child|IO::Async::Notifier/remove_child>, L<remove_from_parent|IO::Async::Notifier/remove_from_parent>

=item L<Net::Async::Slack::Commands>

L<admin_apps_approve|Net::Async::Slack::Commands/admin_apps_approve>, L<admin_apps_approved_list|Net::Async::Slack::Commands/admin_apps_approved_list>, L<admin_apps_requests_list|Net::Async::Slack::Commands/admin_apps_requests_list>, L<admin_apps_restrict|Net::Async::Slack::Commands/admin_apps_restrict>, L<admin_apps_restricted_list|Net::Async::Slack::Commands/admin_apps_restricted_list>, L<admin_conversations_archive|Net::Async::Slack::Commands/admin_conversations_archive>, L<admin_conversations_convert_to_private|Net::Async::Slack::Commands/admin_conversations_convert_to_private>, L<admin_conversations_create|Net::Async::Slack::Commands/admin_conversations_create>, L<admin_conversations_delete|Net::Async::Slack::Commands/admin_conversations_delete>, L<admin_conversations_disconnect_shared|Net::Async::Slack::Commands/admin_conversations_disconnect_shared>, L<admin_conversations_ekm_list_original_connected_channel_info|Net::Async::Slack::Commands/admin_conversations_ekm_list_original_connected_channel_info>, L<admin_conversations_get_conversation_prefs|Net::Async::Slack::Commands/admin_conversations_get_conversation_prefs>, L<admin_conversations_get_teams|Net::Async::Slack::Commands/admin_conversations_get_teams>, L<admin_conversations_invite|Net::Async::Slack::Commands/admin_conversations_invite>, L<admin_conversations_rename|Net::Async::Slack::Commands/admin_conversations_rename>, L<admin_conversations_restrict_access_add_group|Net::Async::Slack::Commands/admin_conversations_restrict_access_add_group>, L<admin_conversations_restrict_access_list_groups|Net::Async::Slack::Commands/admin_conversations_restrict_access_list_groups>, L<admin_conversations_restrict_access_remove_group|Net::Async::Slack::Commands/admin_conversations_restrict_access_remove_group>, L<admin_conversations_search|Net::Async::Slack::Commands/admin_conversations_search>, L<admin_conversations_set_conversation_prefs|Net::Async::Slack::Commands/admin_conversations_set_conversation_prefs>, L<admin_conversations_set_teams|Net::Async::Slack::Commands/admin_conversations_set_teams>, L<admin_conversations_unarchive|Net::Async::Slack::Commands/admin_conversations_unarchive>, L<admin_emoji_add|Net::Async::Slack::Commands/admin_emoji_add>, L<admin_emoji_add_alias|Net::Async::Slack::Commands/admin_emoji_add_alias>, L<admin_emoji_list|Net::Async::Slack::Commands/admin_emoji_list>, L<admin_emoji_remove|Net::Async::Slack::Commands/admin_emoji_remove>, L<admin_emoji_rename|Net::Async::Slack::Commands/admin_emoji_rename>, L<admin_invite_requests_approve|Net::Async::Slack::Commands/admin_invite_requests_approve>, L<admin_invite_requests_approved_list|Net::Async::Slack::Commands/admin_invite_requests_approved_list>, L<admin_invite_requests_denied_list|Net::Async::Slack::Commands/admin_invite_requests_denied_list>, L<admin_invite_requests_deny|Net::Async::Slack::Commands/admin_invite_requests_deny>, L<admin_invite_requests_list|Net::Async::Slack::Commands/admin_invite_requests_list>, L<admin_teams_admins_list|Net::Async::Slack::Commands/admin_teams_admins_list>, L<admin_teams_create|Net::Async::Slack::Commands/admin_teams_create>, L<admin_teams_list|Net::Async::Slack::Commands/admin_teams_list>, L<admin_teams_owners_list|Net::Async::Slack::Commands/admin_teams_owners_list>, L<admin_teams_settings_info|Net::Async::Slack::Commands/admin_teams_settings_info>, L<admin_teams_settings_set_default_channels|Net::Async::Slack::Commands/admin_teams_settings_set_default_channels>, L<admin_teams_settings_set_description|Net::Async::Slack::Commands/admin_teams_settings_set_description>, L<admin_teams_settings_set_discoverability|Net::Async::Slack::Commands/admin_teams_settings_set_discoverability>, L<admin_teams_settings_set_icon|Net::Async::Slack::Commands/admin_teams_settings_set_icon>, L<admin_teams_settings_set_name|Net::Async::Slack::Commands/admin_teams_settings_set_name>, L<admin_usergroups_add_channels|Net::Async::Slack::Commands/admin_usergroups_add_channels>, L<admin_usergroups_add_teams|Net::Async::Slack::Commands/admin_usergroups_add_teams>, L<admin_usergroups_list_channels|Net::Async::Slack::Commands/admin_usergroups_list_channels>, L<admin_usergroups_remove_channels|Net::Async::Slack::Commands/admin_usergroups_remove_channels>, L<admin_users_assign|Net::Async::Slack::Commands/admin_users_assign>, L<admin_users_invite|Net::Async::Slack::Commands/admin_users_invite>, L<admin_users_list|Net::Async::Slack::Commands/admin_users_list>, L<admin_users_remove|Net::Async::Slack::Commands/admin_users_remove>, L<admin_users_session_invalidate|Net::Async::Slack::Commands/admin_users_session_invalidate>, L<admin_users_session_reset|Net::Async::Slack::Commands/admin_users_session_reset>, L<admin_users_set_admin|Net::Async::Slack::Commands/admin_users_set_admin>, L<admin_users_set_expiration|Net::Async::Slack::Commands/admin_users_set_expiration>, L<admin_users_set_owner|Net::Async::Slack::Commands/admin_users_set_owner>, L<admin_users_set_regular|Net::Async::Slack::Commands/admin_users_set_regular>, L<api_test|Net::Async::Slack::Commands/api_test>, L<apps_event_authorizations_list|Net::Async::Slack::Commands/apps_event_authorizations_list>, L<apps_permissions_info|Net::Async::Slack::Commands/apps_permissions_info>, L<apps_permissions_request|Net::Async::Slack::Commands/apps_permissions_request>, L<apps_permissions_resources_list|Net::Async::Slack::Commands/apps_permissions_resources_list>, L<apps_permissions_scopes_list|Net::Async::Slack::Commands/apps_permissions_scopes_list>, L<apps_permissions_users_list|Net::Async::Slack::Commands/apps_permissions_users_list>, L<apps_permissions_users_request|Net::Async::Slack::Commands/apps_permissions_users_request>, L<apps_uninstall|Net::Async::Slack::Commands/apps_uninstall>, L<auth_revoke|Net::Async::Slack::Commands/auth_revoke>, L<auth_test|Net::Async::Slack::Commands/auth_test>, L<bots_info|Net::Async::Slack::Commands/bots_info>, L<calls_add|Net::Async::Slack::Commands/calls_add>, L<calls_end|Net::Async::Slack::Commands/calls_end>, L<calls_info|Net::Async::Slack::Commands/calls_info>, L<calls_participants_add|Net::Async::Slack::Commands/calls_participants_add>, L<calls_participants_remove|Net::Async::Slack::Commands/calls_participants_remove>, L<calls_update|Net::Async::Slack::Commands/calls_update>, L<chat_delete|Net::Async::Slack::Commands/chat_delete>, L<chat_delete_scheduled_message|Net::Async::Slack::Commands/chat_delete_scheduled_message>, L<chat_get_permalink|Net::Async::Slack::Commands/chat_get_permalink>, L<chat_me_message|Net::Async::Slack::Commands/chat_me_message>, L<chat_post_ephemeral|Net::Async::Slack::Commands/chat_post_ephemeral>, L<chat_post_message|Net::Async::Slack::Commands/chat_post_message>, L<chat_schedule_message|Net::Async::Slack::Commands/chat_schedule_message>, L<chat_scheduled_messages_list|Net::Async::Slack::Commands/chat_scheduled_messages_list>, L<chat_unfurl|Net::Async::Slack::Commands/chat_unfurl>, L<chat_update|Net::Async::Slack::Commands/chat_update>, L<conversations_archive|Net::Async::Slack::Commands/conversations_archive>, L<conversations_close|Net::Async::Slack::Commands/conversations_close>, L<conversations_create|Net::Async::Slack::Commands/conversations_create>, L<conversations_invite|Net::Async::Slack::Commands/conversations_invite>, L<conversations_join|Net::Async::Slack::Commands/conversations_join>, L<conversations_kick|Net::Async::Slack::Commands/conversations_kick>, L<conversations_leave|Net::Async::Slack::Commands/conversations_leave>, L<conversations_list|Net::Async::Slack::Commands/conversations_list>, L<conversations_mark|Net::Async::Slack::Commands/conversations_mark>, L<conversations_members|Net::Async::Slack::Commands/conversations_members>, L<conversations_open|Net::Async::Slack::Commands/conversations_open>, L<conversations_rename|Net::Async::Slack::Commands/conversations_rename>, L<conversations_replies|Net::Async::Slack::Commands/conversations_replies>, L<conversations_set_purpose|Net::Async::Slack::Commands/conversations_set_purpose>, L<conversations_set_topic|Net::Async::Slack::Commands/conversations_set_topic>, L<conversations_unarchive|Net::Async::Slack::Commands/conversations_unarchive>, L<dialog_open|Net::Async::Slack::Commands/dialog_open>, L<dnd_end_dnd|Net::Async::Slack::Commands/dnd_end_dnd>, L<dnd_end_snooze|Net::Async::Slack::Commands/dnd_end_snooze>, L<dnd_info|Net::Async::Slack::Commands/dnd_info>, L<dnd_set_snooze|Net::Async::Slack::Commands/dnd_set_snooze>, L<dnd_team_info|Net::Async::Slack::Commands/dnd_team_info>, L<emoji_list|Net::Async::Slack::Commands/emoji_list>, L<files_comments_delete|Net::Async::Slack::Commands/files_comments_delete>, L<files_delete|Net::Async::Slack::Commands/files_delete>, L<files_info|Net::Async::Slack::Commands/files_info>, L<files_list|Net::Async::Slack::Commands/files_list>, L<files_remote_add|Net::Async::Slack::Commands/files_remote_add>, L<files_remote_info|Net::Async::Slack::Commands/files_remote_info>, L<files_remote_list|Net::Async::Slack::Commands/files_remote_list>, L<files_remote_remove|Net::Async::Slack::Commands/files_remote_remove>, L<files_remote_share|Net::Async::Slack::Commands/files_remote_share>, L<files_remote_update|Net::Async::Slack::Commands/files_remote_update>, L<files_revoke_public_url|Net::Async::Slack::Commands/files_revoke_public_url>, L<files_shared_public_url|Net::Async::Slack::Commands/files_shared_public_url>, L<files_upload|Net::Async::Slack::Commands/files_upload>, L<migration_exchange|Net::Async::Slack::Commands/migration_exchange>, L<oauth_access|Net::Async::Slack::Commands/oauth_access>, L<oauth_token|Net::Async::Slack::Commands/oauth_token>, L<oauth_v2_access|Net::Async::Slack::Commands/oauth_v2_access>, L<pins_add|Net::Async::Slack::Commands/pins_add>, L<pins_list|Net::Async::Slack::Commands/pins_list>, L<pins_remove|Net::Async::Slack::Commands/pins_remove>, L<reactions_add|Net::Async::Slack::Commands/reactions_add>, L<reactions_get|Net::Async::Slack::Commands/reactions_get>, L<reactions_list|Net::Async::Slack::Commands/reactions_list>, L<reactions_remove|Net::Async::Slack::Commands/reactions_remove>, L<reminders_add|Net::Async::Slack::Commands/reminders_add>, L<reminders_complete|Net::Async::Slack::Commands/reminders_complete>, L<reminders_delete|Net::Async::Slack::Commands/reminders_delete>, L<reminders_info|Net::Async::Slack::Commands/reminders_info>, L<reminders_list|Net::Async::Slack::Commands/reminders_list>, L<rtm_connect|Net::Async::Slack::Commands/rtm_connect>, L<search_messages|Net::Async::Slack::Commands/search_messages>, L<stars_add|Net::Async::Slack::Commands/stars_add>, L<stars_list|Net::Async::Slack::Commands/stars_list>, L<stars_remove|Net::Async::Slack::Commands/stars_remove>, L<team_access_logs|Net::Async::Slack::Commands/team_access_logs>, L<team_billable_info|Net::Async::Slack::Commands/team_billable_info>, L<team_info|Net::Async::Slack::Commands/team_info>, L<team_integration_logs|Net::Async::Slack::Commands/team_integration_logs>, L<team_profile_get|Net::Async::Slack::Commands/team_profile_get>, L<usergroups_create|Net::Async::Slack::Commands/usergroups_create>, L<usergroups_disable|Net::Async::Slack::Commands/usergroups_disable>, L<usergroups_enable|Net::Async::Slack::Commands/usergroups_enable>, L<usergroups_list|Net::Async::Slack::Commands/usergroups_list>, L<usergroups_update|Net::Async::Slack::Commands/usergroups_update>, L<usergroups_users_list|Net::Async::Slack::Commands/usergroups_users_list>, L<usergroups_users_update|Net::Async::Slack::Commands/usergroups_users_update>, L<users_conversations|Net::Async::Slack::Commands/users_conversations>, L<users_delete_photo|Net::Async::Slack::Commands/users_delete_photo>, L<users_get_presence|Net::Async::Slack::Commands/users_get_presence>, L<users_identity|Net::Async::Slack::Commands/users_identity>, L<users_info|Net::Async::Slack::Commands/users_info>, L<users_list|Net::Async::Slack::Commands/users_list>, L<users_lookup_by_email|Net::Async::Slack::Commands/users_lookup_by_email>, L<users_profile_get|Net::Async::Slack::Commands/users_profile_get>, L<users_profile_set|Net::Async::Slack::Commands/users_profile_set>, L<users_set_active|Net::Async::Slack::Commands/users_set_active>, L<users_set_photo|Net::Async::Slack::Commands/users_set_photo>, L<users_set_presence|Net::Async::Slack::Commands/users_set_presence>, L<views_open|Net::Async::Slack::Commands/views_open>, L<views_publish|Net::Async::Slack::Commands/views_publish>, L<views_push|Net::Async::Slack::Commands/views_push>, L<views_update|Net::Async::Slack::Commands/views_update>, L<workflows_step_completed|Net::Async::Slack::Commands/workflows_step_completed>, L<workflows_step_failed|Net::Async::Slack::Commands/workflows_step_failed>, L<workflows_update_step|Net::Async::Slack::Commands/workflows_update_step>

=back

=head1 AUTHOR

Tom Molesworth <TEAM@cpan.org>

=head1 LICENSE

Copyright Tom Molesworth 2016-2021. Licensed under the same terms as Perl itself.

