sql

package
v0.0.0-...-5db6154 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULE_USER_ID = 777000

Variables

View Source
var SESSION *gorm.DB

Functions

func AddFilter

func AddFilter(name, value string)

func AddNote

func AddNote(name, value string)

func DeleteFilter

func DeleteFilter(name string) bool

func DeleteNote

func DeleteNote(name string) bool

func LoadDB

func LoadDB(LOGGER *waLogger.Logger) *sqlOrig.DB

func ShouldAllowFilters

func ShouldAllowFilters(chatId string, shouldAllow bool)

func ShouldSilentAFK

func ShouldSilentAFK(chatId string, silentAFK bool)

func ToggleAfk

func ToggleAfk(option bool, reason string)

Types

type Afk

type Afk struct {
	ChatId  int `gorm:"primary_key"`
	Working bool
	Reason  string
}

func GetAfkStatus

func GetAfkStatus() *Afk

type ChatSettings

type ChatSettings struct {
	ChatId       string `gorm:"primary_key"`
	AllowFilters bool
	SilentAFK    bool
}

func GetChatSettings

func GetChatSettings(chatId string) *ChatSettings

type Filter

type Filter struct {
	Name  string `gorm:"primary_key"`
	Value string
}

func GetFilter

func GetFilter(name string) *Filter

func GetFilters

func GetFilters() []Filter

type Note

type Note struct {
	Name  string `gorm:"primary_key"`
	Value string
}

func GetNote

func GetNote(name string) *Note

func GetNotes

func GetNotes() []Note

Jump to

Keyboard shortcuts

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