bot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

This is the main structure around which the entire project is built.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

func New

func New(
	Token string,
	Client http.Client,
	Logger logger.Logger,
) (bot *Bot, err error)

func (Bot) GetMe

func (b Bot) GetMe() (*types.User, error)

func (Bot) GetUpdates

func (b Bot) GetUpdates(
	args GetUpdatesArguments,
) (update []types.Update, err error)

GetUpdates https://core.telegram.org/bots/api#getupdates

func (Bot) MakeRequest

func (b Bot) MakeRequest(method string, params map[string]string) (result json.RawMessage, err error)

func (Bot) RunPolling

func (bot Bot) RunPolling(args GetUpdatesArguments) (err error)

type GetUpdatesArguments

type GetUpdatesArguments struct {
	Offset         *uint64
	Limit          int
	Timeout        int
	AllowedUpdates []string
}

Jump to

Keyboard shortcuts

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