Slack v0.10.0 Slack.Lookups

Summary

Functions

Turns a string like "#CHANNEL_NAME" into the ID that Slack understands ("C…") if a public channel, ("G…") if a group/private channel

Turns a Slack private channel ID ("G…") into a string in the format “#CHANNEL_NAME”

Turns a string like "@USER_NAME" or a user ID ("U…") into the ID for the direct message channel of that user ("D…"). nil is returned if a direct message channel has not yet been opened

Turns a string like "@USER_NAME" into the ID that Slack understands ("U…")

Turns a Slack user ID ("U…") or direct message ID ("D…") into a string in the format “@USER_NAME”

Functions

lookup_channel_id(arg, slack)

Turns a string like "#CHANNEL_NAME" into the ID that Slack understands ("C…") if a public channel, ("G…") if a group/private channel.

lookup_channel_name(arg, slack)

Turns a Slack private channel ID ("G…") into a string in the format “#CHANNEL_NAME”.

lookup_direct_message_id(user_id, slack)

Turns a string like "@USER_NAME" or a user ID ("U…") into the ID for the direct message channel of that user ("D…"). nil is returned if a direct message channel has not yet been opened.

lookup_user_id(arg, slack)

Turns a string like "@USER_NAME" into the ID that Slack understands ("U…").

lookup_user_name(arg, slack)

Turns a Slack user ID ("U…") or direct message ID ("D…") into a string in the format “@USER_NAME”.