WardrikSlack (wardrik_slack v0.1.0-rc.1)
Copy MarkdownSlack for Wardrik. A WardrikChannel adapter for a Slack app of your own.
Agents answer in threads. Before a call they can't make alone, they ask there, with Approve and Deny buttons.
config :my_app, MyApp.AgentRuntime,
channels: [
slack:
{WardrikSlack,
token: "xoxb-...",
signing_secret: "...",
owner: "acme",
approvers: ["@maria"]}
]Options
Takes WardrikChannel's options, such as :owner and :approvers, and these:
:token- the bot token,xoxb-.... Adds the app to the one workspace it belongs to.:signing_secret- takes Slack's requests over HTTP, at/v1/channels/{channel}/eventsand/v1/channels/{channel}/actions. SeeWardrikSlack.HTTP.:app_token- an app-level token,xapp-..., withconnections:write. Takes Slack's requests over Socket Mode instead, with no public address. For testing. SeeWardrikSlack.Socket.:client_id,:client_secret,:redirect_uri- add one app to many workspaces. SeeWardrikSlack.Install.:req_options- merged into every request to Slack.
Over Socket Mode, give Wardrik a Slack app of its own. Slack spreads an app's events across every open connection.
Approvers
:approvers are named by @handle, email address or Slack member ID, or :anyone.
- A call an agent waits on is sent to each approver in the app's Messages tab, with a link to its thread.
- The thread says who it waits on.
- If Slack reaches none of them, the call is asked in the thread instead.
In the thread
- While an agent works, the thread shows what it's doing as the app's status.
- A message the agent takes gets :eyes:, then :white_check_mark: once it's answered.
Summary
Functions
Checks a channel's tokens with Slack.
Returns whether member is among names. Each name is a @handle, email address or member ID.
Returns the URL where someone acting for owner adds the app. See WardrikSlack.Install.url/3.
Adds the app to a workspace once Slack sends someone back. See WardrikSlack.Install.installed/3.
Returns the name of the task supervisor that handles what Slack sends the channel.
Uninstalls the app from workspace and forgets the workspace.
Functions
Checks a channel's tokens with Slack.
WardrikSlack.check(token: "xoxb-...", app_token: "xapp-...")
#=> {:ok, "posts as @wardrik in Acme"}
WardrikSlack.check(token: "xoxb-wrong")
#=> {:error, "Slack refused its token: "invalid_auth""}Checks :token with auth.test, and :app_token by opening a Socket Mode URL. Without
:token, the channel keeps a token for each workspace, and those aren't checked.
Returns whether member is among names. Each name is a @handle, email address or member ID.
Returns the URL where someone acting for owner adds the app. See WardrikSlack.Install.url/3.
Adds the app to a workspace once Slack sends someone back. See WardrikSlack.Install.installed/3.
@spec tasks(WardrikChannel.Channel.t()) :: atom()
Returns the name of the task supervisor that handles what Slack sends the channel.
Uninstalls the app from workspace and forgets the workspace.
The workspace is forgotten even if Slack refuses. Slack confirms with an app_uninstalled event.