telegramnotifier

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interaction added in v1.4.0

type Interaction struct {
	AuthToken string

	StartCallbacks []func()
	AuthCallbacks  []func(user *telebot.User)
	// contains filtered or unexported fields
}

func NewInteraction added in v1.4.0

func NewInteraction(bot *telebot.Bot, store service.Store) *Interaction

func (*Interaction) EmitAuth added in v1.4.0

func (it *Interaction) EmitAuth(user *telebot.User)

func (*Interaction) HandleAuth added in v1.4.0

func (it *Interaction) HandleAuth(m *telebot.Message)

func (*Interaction) HandleHelp added in v1.4.0

func (it *Interaction) HandleHelp(m *telebot.Message)

func (*Interaction) HandleInfo added in v1.4.0

func (it *Interaction) HandleInfo(m *telebot.Message)

func (*Interaction) OnAuth added in v1.4.0

func (it *Interaction) OnAuth(cb func(user *telebot.User))

func (*Interaction) SendToOwner added in v1.4.0

func (it *Interaction) SendToOwner(message string)

func (*Interaction) Session added in v1.4.0

func (it *Interaction) Session() *Session

func (*Interaction) SetAuthToken added in v1.4.0

func (it *Interaction) SetAuthToken(token string)

func (*Interaction) Start added in v1.4.0

func (it *Interaction) Start(session Session)

type Notifier

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

func New

func New(interaction *Interaction, options ...NotifyOption) *Notifier

New TODO: register interaction with channel, so that we can route message to the specific telegram bot

func (*Notifier) Notify

func (n *Notifier) Notify(obj interface{}, args ...interface{})

func (*Notifier) NotifyTo

func (n *Notifier) NotifyTo(channel string, obj interface{}, args ...interface{})

type NotifyOption

type NotifyOption func(notifier *Notifier)

type Session added in v1.4.0

type Session struct {
	Owner              *telebot.User `json:"owner"`
	Chat               *telebot.Chat `json:"chat"`
	OneTimePasswordKey *otp.Key      `json:"otpKey"`
}

func NewSession added in v1.4.0

func NewSession(key *otp.Key) Session

Jump to

Keyboard shortcuts

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