db

package
v0.0.0-...-0a31e69 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChat

func AddChat(botId int64, chatId int64) error

AddChat adds a chat to the stats

func AddUser

func AddUser(botId int64, userId int64) error

AddUser adds a user to the stats

func AllChats

func AllChats(botId int64) ([]int64, error)

AllChats gets all chats in the stats

func AllUsers

func AllUsers(botId int64) ([]int64, error)

AllUsers gets all users in the stats

func GetAllBots

func GetAllBots() ([]int64, error)

GetAllBots gets all bots in the stats

func IsMuted

func IsMuted(chatId int64, userId int64) (bool, error)

IsMuted checks if a user is muted

func RemoveMuted

func RemoveMuted(chatId int64, userid int64) error

RemoveMuted removes a user from the muted list

func SetFSub

func SetFSub(chatId int64, fSub bool) error

SetFSub sets the FSub setting for a chat

func SetFSubChannel

func SetFSubChannel(chatId int64, channel int64) error

SetFSubChannel sets the FSub setting for a chat

func SetFSubSetting

func SetFSubSetting(fSub *FSub) error

SetFSubSetting sets the FSub setting for a chat

func Shutdown

func Shutdown()

Shutdown performs cleanup tasks

func UpdateMuted

func UpdateMuted(chatId int64, userid int64) error

UpdateMuted adds a user to the muted list

Types

type FSub

type FSub struct {
	ChatId          int64   `json:"chatId"`
	ForceSub        bool    `json:"forceSub"`
	ForceSubChannel int64   `json:"forceSubChannel"`
	FSubMuted       []int64 `json:"mutedUsers"`
}

func GetFSubSetting

func GetFSubSetting(chatId int64) (*FSub, error)

GetFSubSetting gets the FSub setting for a chat

type State

type State struct {
	BotID int64   `json:"botId"`
	Chats []int64 `json:"chats"`
	Users []int64 `json:"users"`
}

func GetStats

func GetStats(botId int64) (*State, error)

Jump to

Keyboard shortcuts

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