p

package module
v0.0.0-...-61478c4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: MIT Imports: 13 Imported by: 0

README

ben-bot

Slack bot

Documentation

Overview

Package p contains an HTTP Cloud Function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GET

func GET(url string) []byte

GET - General function to send get REST Request

func Main

func Main(w http.ResponseWriter, r *http.Request)

Main function. Will manage message received from Slack and will send back a reply to the matching channel

Types

type Challenge

type Challenge struct {
	Token     string `json:"token"`
	Challenge string `json:"challenge"`
	Type      string `json:"type"`
}

Challenge from Slack

type ChallengeResponse

type ChallengeResponse struct {
	Challenge string `json:"challenge"`
}

ChallengeResponse response from Slack Challenge

type Joke

type Joke struct {
	Attachments []struct {
		Fallback string `json:"fallback"`
		Footer   string `json:"footer"`
		Text     string `json:"text"`
	} `json:"attachments"`
	ResponseType string `json:"response_type"`
	Username     string `json:"username"`
}

Joke from API

Jump to

Keyboard shortcuts

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