tgb

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 7 Imported by: 0

README

telegram-bot

Telegram bot with rate limit

Rate limit

https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this

  • chat
    • one message per second
  • 30 messages per second
  • 20 messages per minute to the same group

Telegram Bot Serve Daemon

Serve as a daemon, send and receive messages from users and groups.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Sugar *zap.SugaredLogger
	// contains filtered or unexported fields
}

func New

func New(token string, coll *mongo.Collection, Sugar *zap.SugaredLogger) (*Bot, error)

func (*Bot) Init added in v0.2.0

func (b *Bot) Init(ctx context.Context) error

func (*Bot) Serve

func (b *Bot) Serve(ctx context.Context, ch <-chan tgbotapi.Chattable) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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