Skip to content

EYDS-CA/fresh_time_counter

 
 

Repository files navigation

Result

Deployment Steps on AWS Lightsail

  • Lightsail: Freshworks-SlackApps
  • Click on connecting ssh
## cd to the root folder
$ cd slack-apps/freshworks-fresh_times-counter

## if you have new update (and make sure you update git remote url, as it's currently pointing to my repo)
$ git pull
  • Update to new docker image (under slack-apps/freshworks-fresh_times-counter)
## Stop and remove container
$ docker stop freshtimes
$ docker rm freshtimes

## Build new image
$ docker build -t freshtimes .
$ docker run -d -p 8888:8888 --name freshtimes freshtimes

usage

create new app

https://api.slack.com/apps

  • Adding scope in OAuth & Permissions

slash command

type /fresh_time in the channel you want to count

slack api

fetch all users info in slack

https://api.slack.com/methods/users.list

fetch all message in channel

https://api.slack.com/methods/conversations.history

fetch all members in channel

https://api.slack.com/methods/conversations.members

Deploy to AWS Lightsail

  • open the port 8888

Refs

https://scotch.io/tutorials/create-a-custom-slack-slash-command-with-nodejs-and-express


V2.0

Key Steps

Add permission and scope

  • Add file .env
cp .env-example .env
API_TOKEN=  // Under OAuth Permission, OAuth Access Token
SLACK_BOT_TOKEN= // Under OAuth Permission, Bot User OAuth Access Token
SLACK_SIGNING_SECRET=  // Under Basic Information
PORT= // whatever you want the port

  • Add chat:write to the bot scope

  • Add path /slack/events to Request URL under Slash Commands.

  • Activate Interactive and shorcuts and Add path /slack/events to Request URL.

Refs

Issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.3%
  • Dockerfile 3.7%
  • Shell 1.0%