telegram

package
v0.0.0-...-25d4934 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Webhook(domain string, f OnMessage) (*Webhook, error)
	Poll(f OnMessage) error
}

Client is an interface for interacting with the Telegram API.

func New

func New(token string) (Client, error)

type Message

type Message struct {
	Text string
	// contains filtered or unexported fields
}

Message represents a message received from Telegram.

func (*Message) Reply

func (m *Message) Reply(reply *Reply) error

Reply sends a reply to the message that triggered the given message.

type OnMessage

type OnMessage func(msg *Message) error

OnMessage is a function that is called for each message received.

type Reply

type Reply struct {
	Text   string
	Styled bool
}

type Webhook

type Webhook struct {
	Handler http.Handler
}

Jump to

Keyboard shortcuts

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