telegram

package
v0.0.0-...-04bcfef Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 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 struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string, pollTimeout time.Duration) (*Client, error)

func (*Client) DisplayName

func (c *Client) DisplayName(u *tb.User) string

DisplayName will generate a "display name" for a user

func (*Client) GetUserName

func (c *Client) GetUserName(m *tb.Message) string

GetUserName will generate a "user name" for a given user

func (*Client) Me

func (c *Client) Me() *tb.User

func (*Client) OnMessage

func (c *Client) OnMessage(handler func(m *tb.Message))

func (*Client) Send

func (c *Client) Send(to tb.Recipient, msg interface{})

Send will send a message to a user

func (*Client) SendAdmin

func (c *Client) SendAdmin(to []Users.User, msg string)

SendAdmin will send an error to all admin users

func (*Client) SendChoices

func (c *Client) SendChoices(to tb.Recipient, msg string, list []string)

SendChoices will send a list of keyboard choices to a user

func (*Client) SendError

func (c *Client) SendError(to tb.Recipient, msg string)

SendError will send an error message to a user

func (*Client) SendMany

func (c *Client) SendMany(to []Users.User, msg string)

SendMany will send a message to multiple users in markdown format

func (*Client) Start

func (c *Client) Start()

Jump to

Keyboard shortcuts

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