telegram

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

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 NewBot

func NewBot(telegramToken string, chats BotChatStore, accounts map[string]*vscale.Account, opts ...BotOption) (*Bot, error)

func (*Bot) Start

func (b *Bot) Start()

type BotChatStore

type BotChatStore interface {
	List() ([]tb.Chat, error)
	Add(tb.Chat) error
	Remove(tb.Chat) error
}

type BotOption

type BotOption func(b *Bot)

func WithAdmin added in v1.5.0

func WithAdmin(a string) BotOption

func WithInterval

func WithInterval(i time.Duration) BotOption

func WithSocks

func WithSocks(s string) BotOption

func WithThreshold

func WithThreshold(t float64) BotOption

func WithVerbose

func WithVerbose(v bool) BotOption

type ChatStore

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

ChatStore writes the users to a libkv store backend

func NewChatStore

func NewChatStore(kv store.Store) (*ChatStore, error)

NewChatStore stores telegram chats in the provided kv backend

func (*ChatStore) Add

func (s *ChatStore) Add(c tb.Chat) error

Add a telegram chat to the kv backend

func (*ChatStore) List

func (s *ChatStore) List() ([]tb.Chat, error)

List all chats saved in the kv backend

func (*ChatStore) Remove

func (s *ChatStore) Remove(c tb.Chat) error

Remove a telegram chat from the kv backend

Jump to

Keyboard shortcuts

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