telegram

package
v0.0.0-...-a285232 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MethodGET is HTTP request method GET
	MethodGET = "GET"
	// MethodPOST is HTTP request method POST
	MethodPOST = "POST"
	// MethodPUT is HTTP request method PUT
	MethodPUT = "PUT"
	// MethodDELETE is HTTP request method DELETE
	MethodDELETE = "DELETE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot represent the Telegram bot

func NewBot

func NewBot(botToken string) *Bot

NewBot return new bot instance

func (*Bot) PrepareWebhook

func (bot *Bot) PrepareWebhook(next http.Handler) http.Handler

PrepareWebhook do prepare webhook context

func (*Bot) Run

func (bot *Bot) Run() error

Run the bot

type Client

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

Client is implementation HTTP(s) client

func NewClient

func NewClient() *Client

NewClient create control client with specified base URL and transport

func (*Client) Call

func (c *Client) Call(ctx context.Context, method, botToken, url string, resp interface{}, req interface{}) (err error)

Call execute ARI request and decode response if necessary

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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