bot

package
v0.0.0-...-0648364 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Automation

type Automation struct {
	*messages.Monitoring

	Username  string
	InputPeer tg.InputPeerClass
	// contains filtered or unexported fields
}

func NewAutomation

func NewAutomation(ctx context.Context, client *telegram.Client, dispatcher tg.UpdateDispatcher, username string, strip bool) (*Automation, error)

NewAutomation creates a new `Automation` object. It requires an username, since all (official) Telegram Bot have an username.

func (*Automation) ReplyToMessage

func (a *Automation) ReplyToMessage(msgID int, text string) error

func (*Automation) SendCallbackData

func (a *Automation) SendCallbackData(msgID int, callbackData string) (*tg.MessagesBotCallbackAnswer, error)

func (*Automation) SendStartMessageWithParams

func (a *Automation) SendStartMessageWithParams(params string) error

SendStartMessageWithParams will start a chat with a bot with the appropriate parameters. For instance, if you receive the link https://t.me/randombot?start=hello, the "hello" parameter will be sent as well.

func (*Automation) SendTextMessage

func (a *Automation) SendTextMessage(text string) error

Jump to

Keyboard shortcuts

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