bot

package
v0.0.0-...-b4f78c5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Test bool

Test helps to use some functions without need to use external APIs

Functions

This section is empty.

Types

type Bot

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

Bot structure

func New

func New(c *config.BotConfig, bundle *i18n.Bundle) (*Bot, error)

New creates a new bot instance

func (*Bot) ChangeGroupTimeZone

func (b *Bot) ChangeGroupTimeZone(event tgbotapi.Update) (string, error)

ChangeGroupTimeZone modifies time zone of the group

func (*Bot) ChangeSubmissionDays

func (b *Bot) ChangeSubmissionDays(event tgbotapi.Update) (string, error)

ChangeSubmissionDays changes days on which interns should submit standups

func (*Bot) ChangeUserTimeZone

func (b *Bot) ChangeUserTimeZone(event tgbotapi.Update) (string, error)

ChangeUserTimeZone assign user a different time zone

func (*Bot) CheckNotificationThread

func (b *Bot) CheckNotificationThread(group *model.Group, t time.Time)

CheckNotificationThread notify users

func (*Bot) EditDeadline

func (b *Bot) EditDeadline(event tgbotapi.Update) (string, error)

EditDeadline modifies standup time

func (*Bot) HandleChannelJoinEvent

func (b *Bot) HandleChannelJoinEvent(event tgbotapi.Update) error

HandleChannelJoinEvent function to add bot and standupers t0 channels

func (*Bot) HandleChannelLeftEvent

func (b *Bot) HandleChannelLeftEvent(event tgbotapi.Update) error

HandleChannelLeftEvent function to remove bot and standupers from channels

func (*Bot) HandleCommand

func (b *Bot) HandleCommand(event tgbotapi.Update) (err error)

HandleCommand handles imcomming commands

func (*Bot) HandleMessageEvent

func (b *Bot) HandleMessageEvent(message *tgbotapi.Message) error

HandleMessageEvent function to analyze and save standups

func (*Bot) Help

func (b *Bot) Help(event tgbotapi.Update) (string, error)

Help displays help message

func (*Bot) JoinStandupers

func (b *Bot) JoinStandupers(event tgbotapi.Update) (string, error)

JoinStandupers assign user a standuper role

func (*Bot) LeaveStandupers

func (b *Bot) LeaveStandupers(event tgbotapi.Update) (string, error)

LeaveStandupers standupers

func (*Bot) NotifyGroup

func (b *Bot) NotifyGroup(group *model.Group, t time.Time)

NotifyGroup launches go routines that notify standupers about upcoming deadlines

func (*Bot) Show

func (b *Bot) Show(event tgbotapi.Update) (string, error)

Show standupers

func (*Bot) Start

func (b *Bot) Start() error

Start bot

func (*Bot) StartWatchers

func (b *Bot) StartWatchers()

StartWatchers looks for new gropus from the channel and start watching it

func (*Bot) UpdateGroupLanguage

func (b *Bot) UpdateGroupLanguage(event tgbotapi.Update) (string, error)

UpdateGroupLanguage updates primary language for the group

func (*Bot) UpdateOnbordingMessage

func (b *Bot) UpdateOnbordingMessage(event tgbotapi.Update) (string, error)

UpdateOnbordingMessage updates welcoming message for the group

func (*Bot) WarnGroup

func (b *Bot) WarnGroup(group *model.Group, t time.Time)

WarnGroup launches go routines that warns standupers about upcoming deadlines

Jump to

Keyboard shortcuts

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