Skip to content

viswanathmohanan/wikibot

Repository files navigation

WikiBot

WikiBot Logo Access Wikipedia content directly from Slack with slash commands

Add to Slack

Usage

Supported Commands

Deploying and Development

Slack

  1. Create your Account at Slack, if you don't already have one.

  2. Create your App at Slack App Creation.

    New Slack App Creation

    Give a name to your app. Select the Workspace where you to install the app to.

  3. Once your Application is created, Click on the Basic Information Page and scroll down to find App Credentials section.

    App Credentials

    Copy the values of Client ID, Client Secret and Signing Secret and store these values in environment variables. Open the shell of your choice and enter,

    $ export CLIENT_ID="<enter your client id>"
    $ export CLIENT_SECRET="<enter your client secret>"
    $ export SLACK_SIGNING_SECRET="<enter your signing secret>"
    
  4. Click on "Incoming Webhooks" Page and slide the toggle of "Activate Incoming Webhooks". Once it is toggled, click on "Add New Webhook to Workspace" button in th end

    Activate Incoming Webhooks

  5. Now, Slack will ask to authorize the access to your workspace. Select any channel from the dropdown box and click "Allow"

    Slack Permission

Deploying to Heroku

Now that we have setup our Slack App, it is time for us to deploy our Application.

Slack will send a request to the Public URL that we've configured in Slash Commands. So, if we are to develop locally, I would suggest you to go with ngrok. Ngrok will provide a secure URL to our localhost server through NAT. Please read Using ngrok to develop locally for Slack for setting up your application to run locally.

Deploy

We'll be using Heroku's platform to deploy the Application

  1. Create a free account, if you already don't have one.
  2. Click on the button below which will automatically take you to the Heroku's Page.
  3. Enter a name for your App and fill the Config Vars that we got from above.

Heroku New App

Configuring Slash Commands

The final step is to configure the slash commands

  1. Click on "Slash Commands" Page and click "Create New Command" button Slash Commands

  2. Refer Slash Commands for list of supported commands

  3. The Request URL will be the URL of your deployed application. If you used Heroku, it'll be something like https://app-name.herokuapp.com. If you are using ngrok, it'll be something like http://39ade6ce6764.ngrok.io Create New Slash Command

  4. Save the Command that you just created.

Updating Heroku Deployment

  1. Login to Heroku and go to your apps' page.
  2. Click on Deploy Tab and follow the instructions to deploy the changes to Heroku.

About

Access Wikipedia content from Slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages