bot

package
v0.0.0-...-92ff8fd Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: GPL-3.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnChanMessage

func OnChanMessage(msg *tgbotapi.Message, bot *Telegram) (bool, error)

func OnCommand

func OnCommand(msg *tgbotapi.Message, bot *Telegram) error

func OnGroupMessage

func OnGroupMessage(msg *tgbotapi.Message, bot *Telegram) (bool, error)

func OnMessage

func OnMessage(msg *tgbotapi.Message, bot *Telegram) error

func OnPrivateChatMessage

func OnPrivateChatMessage(msg *tgbotapi.Message, bot *Telegram) (bool, error)

func OnSuperGroupMessage

func OnSuperGroupMessage(msg *tgbotapi.Message, bot *Telegram) (bool, error)

func OnUserAddOnGroup

func OnUserAddOnGroup(msg *tgbotapi.Message, bot *Telegram) (bool, error)

Types

type Bot

type Bot interface {
	SendMessage(username string, text string) error
	SendImage(username string, path string) error
	Run() error
	Stop()
}

func NewTelegram

func NewTelegram(api string, users []string, timeout int, cb msgCallback, debug bool, profilePath string) (Bot, error)

type BotMessage

type BotMessage struct {
	From         string
	Content      interface{}
	ChatName     string
	IsGroup      bool
	IsPrivate    bool
	IsSuperGroup bool
	IsChannel    bool
	IsCommand    bool
}

type CallbackArgument

type CallbackArgument struct {
	T   *Telegram
	Msg *tgbotapi.Message
}

type Telegram

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

func (*Telegram) CacheUsername

func (t *Telegram) CacheUsername(username string, id int64) bool

func (*Telegram) GetCommandArgs

func (t *Telegram) GetCommandArgs(cmd string) (string, []string, error)

func (*Telegram) Run

func (t *Telegram) Run() error

func (*Telegram) SendAudio

func (t *Telegram) SendAudio(username string, path string) error

func (*Telegram) SendFile

func (t *Telegram) SendFile(username string, path string) error

func (*Telegram) SendImage

func (t *Telegram) SendImage(username string, path string) error

func (*Telegram) SendMessage

func (t *Telegram) SendMessage(username string, text string) error

func (*Telegram) SendVideo

func (t *Telegram) SendVideo(username string, path string) error

func (*Telegram) Stop

func (t *Telegram) Stop()

Jump to

Keyboard shortcuts

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