bot

package
v0.0.0-...-7c42c27 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationName = "Mattermost Talks Voting Bot"
	ChannelLogName  = "talks-voting-bot-debug"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func ExtractBotFromContext

func ExtractBotFromContext(ctx context.Context) *Bot

func ExtractBotFromRequest

func ExtractBotFromRequest(r *http.Request) *Bot

func NewBot

func NewBot(serverUrl, accessToken, storageUrl, urlBase, teamName string, enableDebugChannel bool) *Bot

func (*Bot) CreateAuthenticationToken

func (b *Bot) CreateAuthenticationToken(userId, channelId string) (token string)
func (b *Bot) CreateLink(userId, channelId, path string, params url.Values) string

func (*Bot) GetBotUser

func (b *Bot) GetBotUser() *model.User

func (*Bot) GetChannelInfo

func (b *Bot) GetChannelInfo(channelId string) *model.Channel

func (*Bot) GetDetailsFromAuthenticationToken

func (b *Bot) GetDetailsFromAuthenticationToken(token string) (userId, channelId string, exists bool)

func (*Bot) GetUserInfo

func (b *Bot) GetUserInfo(userId string) *model.User

func (*Bot) IsRegistered

func (b *Bot) IsRegistered(channelId string) bool

func (*Bot) SaveRegistration

func (b *Bot) SaveRegistration(r *storage.Registration) error

func (*Bot) SendMsgToDebuggingChannel

func (b *Bot) SendMsgToDebuggingChannel(msg string, replyToId string)

func (*Bot) TouchAuthenticationToken

func (b *Bot) TouchAuthenticationToken(token string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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