tg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

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

Listener listener for telegram

func NewListener

func NewListener(accessToken, host string) (*Listener, error)

NewListener return new tg listener

func (*Listener) ClientName added in v0.0.2

func (l *Listener) ClientName() easybot.Client

func (*Listener) Listen

func (l *Listener) Listen(pattern string) error

Listen tg webhook

func (*Listener) Message

func (l *Listener) Message() <-chan interface{}

Message implement listener interface for app

type Notifier

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

Notifier tg notifier

func NewNotifier

func NewNotifier(accessToken string) (*Notifier, error)

NewNotifier return new tg notifier

func (*Notifier) SendMessage

func (n *Notifier) SendMessage(userID int, text string) error

SendMessage implement notifier interface

func (*Notifier) SetBeforeSendHook

func (n *Notifier) SetBeforeSendHook(hook func(m *tg.MessageConfig))

SetBeforeSendHook set hook for change message before send

Jump to

Keyboard shortcuts

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