slacktimer

package module
v0.0.0-...-7a1693d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 10 Imported by: 0

README

X-BOT

A Slack BOT who does anything.

Commands

@bot is your BOT's name.

@bot c|contribute

Post the URL to contribute.

@bot h|httpcat

Post a picture of a cat with HTTP Cats.

@bot j|joke

Post a joke with the Joke API.

@bot l|list

Post a list of commands.

@bot o|ojichat

Post an ojichat with the ojichat.
Valid arguments are the following.

  • @bot ojichat
  • @bot ojichat @skmatz
  • @bot ojichat @skmatz 3
@bot p|pick

Pick randomly.
Valid arguments are the following.

  • @bot pick 3 a b c d e
@bot ping

Check to see if the BOT server is working properly.
If it is working, the BOT posts the message pong to the same channel.

@bot t|timer

Measure the time.
Valid arguments are the following.

  • @bot timer 3: Measure 3 seconds.
  • @bot timer 3 sec: Measure 3 seconds.
  • @bot timer 3 min: Measure 3 minutes.
  • @bot timer 3 sec Hello, world!: Measure 3 seconds with the memo: "Hello, world!".

Develop

Add a BOT with app_mentions:read, chat:write and files:write permissions to your Slack workspace and set .env.

docker-compose up --build

Deploy

I recommend using Cloud Run provided by GCP.
You just select the forked-repository, set two environment variables, and set an endpoint for the Slack event API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppHandler

type AppHandler struct {
	// contains filtered or unexported fields
}

func (AppHandler) ServeHTTP

func (a AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) Init

func (s *Server) Init()

func (*Server) Route

func (s *Server) Route() *mux.Router

func (*Server) Run

func (s *Server) Run(port int) error

Directories

Path Synopsis
cmd
x-bot command

Jump to

Keyboard shortcuts

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