Skip to content

Commit

Permalink
Some setup and install and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
smocky committed Aug 12, 2021
1 parent 8d57389 commit 7e54554
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SLACK_SIGNING_SECRET=1234
SLACK_BOT_TOKEN=xoxb-1234
SLACK_APP_TOKEN=xapp-1234
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# randopicker
# Select a random member from a channel
Use either the `/rando` slash command to use the pre-coded text or use the Workflow Builder "step from app" with the channel the workflow is called from and the user who called it. Then make a step to have a message using the Random User.

This is set up to exclude the user who called the command or workflow as well as excluding all apps and bots.

## Installing

**Create Slack App**
1. Open [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and choose "From an app manifest"
2. Choose the workspace you want to install the application to
3. Copy the contents of [manifest.yml](manifest.yml) into the text box that says `*Paste your manifest code here*` and click *Next*
4. Review the configuration and click *Create*
5. Now click *Install to Workspace* and *Allow* on the screen that follows. You'll be redirected to the App Configuration dashboard.

**Environment variables**
Before you can run the app, you'll need to store some environment variables.

1. Copy `.env.sample` to `.env`
2. Open your apps configuration page from [this list](https://api.slack.com/apps), click *OAuth & Permissions* in the left hand menu, then copy the *Bot User OAuth Token* into your `.env` file under `SLACK_BOT_TOKEN`
3. Click *Basic Information* from the left hand menu and follow the steps in the *App-Level Tokens* section to create an app-level token with the `connections:write` scope. Copy that token into your `.env` as `SLACK_APP_TOKEN`.
40 changes: 40 additions & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
_metadata:
major_version: 1
minor_version: 1
display_information:
name: RandoPicker
features:
app_home:
home_tab_enabled: false
messages_tab_enabled: true
messages_tab_read_only_enabled: true
bot_user:
display_name: RandoPicker
always_online: false
slash_commands:
- command: /rando
description: Pick a rando
should_escape: false
workflow_steps:
- name: Get a Random Channel Member
callback_id: get_random_member
oauth_config:
scopes:
bot:
- channels:read
- chat:write
- chat:write.public
- commands
- groups:read
- groups:write
- workflow.steps:execute
- users:read
settings:
event_subscriptions:
bot_events:
- workflow_step_execute
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false

0 comments on commit 7e54554

Please sign in to comment.