![]() client - The client that makes calls to Slack.įor all but socket and client, you can see what types of data to expect each of the.ims (direct message channels) - Stored as a map with id's as keys.users - Stored as a map with id's as keys.groups - Stored as a map with id's as keys.channels - Stored as a map with id's as keys.bots - Stored as a map with id's as keys.team - The current team's information stored as a map of properties.me - The current bot/users information stored as a map of properties.State related to Slack including a list of channels, users, groups, bots, and The Slack argument that's passed to each callback is what contains all of the handle_info(message, slack, state) - called when any other message is received in the process mailbox.handle_close(reason, slack, state) - called when websocket is closed before process is terminated.handle_event(message, slack, state) - called when a message is received.handle_connect(slack, state) - called when connected to Slack. ![]() Handle_event/3 in your bots to prevent crashing. Because of this it's wise to write a catch-all Slack RTM API defines many different types of The message type is pattern matched against because the The text content is "Hi" and if so, we reply with our own greeting. In this example we're just matching against the message type and checking if Slack argument holds the state of Slack and is kept up to date Handle_* methods are always passed slack and state arguments. To use this module you'll need a need a Slack API token which can be retrievedīy following the Token Generation Instructions or by creating a new botĭefmodule Bot do use Slack def handle_event ( message = % end Slack.Bot. Messaging API through a Websocket connection. Slack is a genserver-ish interface for working with the Slack real time
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |