bot

package
v0.0.0-...-eb336c4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bot

func Bot(botToken string) *tb.Bot

func GetBoss

func GetBoss(sylon *Sylon) *tb.Chat

func Notify

func Notify(message string)

DEPRECATED. This relies on env variables.

func RandStringBytesMaskImpr

func RandStringBytesMaskImpr(n int) string

Types

type Chat

type Chat struct{}

type Sylon

type Sylon struct {
	Log    *zap.Logger
	R      *sqlx.DB
	Config *storage.InternalConfig
	B      *tb.Bot
	Chat   *tb.Chat
	Cache  caching.Cache
}

func InitSylon

func InitSylon(
	r *sqlx.DB,
	config *storage.InternalConfig,
	b *tb.Bot,
	cache caching.Cache,
	lg *zap.Logger,
) *Sylon

func (*Sylon) CSend

func (d *Sylon) CSend(msg string, options ...interface{})

func (*Sylon) JustSend

func (d *Sylon) JustSend(to tb.Recipient, msg string, options ...interface{})

func (*Sylon) NotifyAboutError

func (s *Sylon) NotifyAboutError(
	projectID, env, service, timestamp, key, flag string,
)

func (*Sylon) PSend

func (d *Sylon) PSend(projectName string, msg string, options ...interface{})

func (*Sylon) RegisterHandlers

func (s *Sylon) RegisterHandlers()

func (*Sylon) Send

func (s *Sylon) Send(
	to tb.Recipient,
	msg string,
	options ...interface{},
) (*tb.Message, error)

func (*Sylon) VerifySender

func (s *Sylon) VerifySender(m *tb.Message) (*models.Project, *models.Chat, bool)

VerifySender returns projectName and if chat is registered

Jump to

Keyboard shortcuts

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