telegram

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ButtonWrapper

type ButtonWrapper struct {
	Button tgbotapi.InlineKeyboardButton
	Choice string
}

type ChatState added in v1.3.0

type ChatState struct {
	Chat             *tgbotapi.Chat
	CallbackResponse *TelegramCallbackResponse
}

type OpTelegram

type OpTelegram struct {
	GE *freepsgraph.GraphEngine
	// contains filtered or unexported fields
}

func (*OpTelegram) GetDefaultConfig added in v1.3.0

func (m *OpTelegram) GetDefaultConfig() interface{}

GetDefaultConfig returns a copy of the default config

func (*OpTelegram) InitCopyOfOperator added in v1.3.0

func (m *OpTelegram) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)

InitCopyOfOperator creates a copy of the operator and initializes it with the given config

func (*OpTelegram) Post added in v1.3.0

func (m *OpTelegram) Post(ctx *base.Context, input *base.OperatorIO, args PostArgs) *base.OperatorIO

Post sends a message to a chat

func (*OpTelegram) Shutdown

func (m *OpTelegram) Shutdown(ctx *base.Context)

func (*OpTelegram) StartListening added in v1.3.0

func (m *OpTelegram) StartListening(ctx *base.Context)

type PostArgs added in v1.3.0

type PostArgs struct {
	ChatID int64
	Text   *string
}

PostArgs are the arguments for the Post function

func (*PostArgs) ChatIDSuggestions added in v1.3.0

func (a *PostArgs) ChatIDSuggestions(op base.FreepsOperator) map[string]string

type TelegramCallbackResponse

type TelegramCallbackResponse struct {
	T string `json:",omitempty"` // TemplateActionID
	F bool   `json:",omitempty"` // Finished ?
	P int    `json:",omitempty"` // processed Args
	C string `json:",omitempty"` // last choice
	K bool   `json:",omitempty"` // request to type value instead of choosing
}

type TelegramConfig

type TelegramConfig struct {
	Enabled            bool
	Token              string
	AllowedUsers       []string
	DebugMessages      bool
	StoreChatNamespace string
}

Jump to

Keyboard shortcuts

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