snbot

package
v0.0.0-...-a81b15a Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Command reqType = 0
	Daily   reqType = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger      log.Logger
	Storage     Storage
	Token       string
	UpdateTime  int
	AccessToken string
}

type SNBot

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

func New

func New(cfg *Config) (*SNBot, error)

func (*SNBot) Run

func (s *SNBot) Run()

func (*SNBot) Send

func (s *SNBot) Send(chatID int64, msg string) error

func (*SNBot) SendCoupons

func (s *SNBot) SendCoupons(chatID int64, cmdArgs string, t reqType) error

func (*SNBot) SendStat

func (s *SNBot) SendStat(chatID int64, args string) error

type Storage

type Storage interface {
	GetNotUseCoupon(cid int64) ([]collector.Record, error)
	GetNotUseCouponCount(cid, count int64) ([]collector.Record, error)
	GetCountUser() (int, error)
	CountNotUseCoupon(cid int64) (uint64, error)
	MarkAsRead(cid int64, rr []collector.Record) error
	NewChat(chat *tgbotapi.Chat) error
	UpdChatActivity(cid int64, act bool) error
}

Jump to

Keyboard shortcuts

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