SlackBot

module
v0.0.0-...-eeef5bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2022 License: MIT

README

Go SlackBot

We are running an slack bot that listens to bot messages in a specified channel to reply to user. This connection is created using RTM stream connection with slack.

Slack Channel --> Message to SlackBot --> Parse Message --> Reply --> Go to slack channel

Slack parameters needed:

  1. token: Bot User OAuth Token in OAuth & Permissions
  2. channelName: Default channel to be used
  3. signingSecret: Available in App Credentials
  4. clientId: Available in App Credentials
  5. clientSecret: Available in App Credentials

Add slack button: https://api.slack.com/docs/slack-button

Enable Home tab to show home screen:

Screenshot 2022-09-25 at 4 50 27 PM

Add interactivity URL for callbacks in section: Interactivity & Shortcuts

URL from current project: /api/v1/slack/interaction

Add slash comment in section: Slash Commands

Slash comment API: /api/v1/slack/command (All commands handled in same API)

Screenshot 2022-09-25 at 4 52 01 PM

Enable events API callback on receiving mentions, home page view etc to take action in Event Subscriptions section:

Event API: /api/v1/slack

Screenshot 2022-09-25 at 4 52 48 PM

Subscribe bot for different events that we want to be called in event API webhook specified:

Screenshot 2022-09-25 at 4 53 02 PM

Directories

Path Synopsis
cmd
core
sql
pkg
api
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL