Documentation ¶
Index ¶
- type ChatSettings
- type Database
- func (db Database) AddUser(userid int64) error
- func (db Database) ConnectUser(user_id int64, chat_id int64)
- func (db Database) DeleteConnection(user_id int64)
- func (db Database) DeleteMfilter(chat_id int64, key string)
- func (db Database) GetAlert(uniqueID string, index int) string
- func (db Database) GetCachedSetting(chat_id int64) *ChatSettings
- func (db Database) GetConnection(user_id int64) (int64, bool)
- func (db Database) GetMfilter(chat_id int64, key string) (bson.M, bool)
- func (db Database) GetMfilters(chat_id int64) (*mongo.Cursor, error)
- func (db Database) RecacheSettings(chat_id int64)
- func (db Database) SaveMfilter(data Filter)
- func (db Database) SetChatSetting(chat_id int64, key string, value any)
- func (db Database) SetDefaultSettings(chat_id int64)
- func (db Database) StartGfilter(chat_id int64, key string)
- func (db Database) Stats() string
- func (db Database) StopGfilter(chat_id int64, key string)
- func (db Database) StringMfilter(chat_id int64) string
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatSettings ¶
type ChatSettings struct { //Stopped Global Filters Stopped []string }
type Database ¶
type Database struct { //Mongo Client Client *mongo.Client //Database Db *mongo.Database //Users Collection Ucol *mongo.Collection //Main Collection Col *mongo.Collection //Manual Filters Collection Mcol *mongo.Collection }
func NewDatabase ¶
func NewDatabase() Database
func (Database) ConnectUser ¶
func (Database) DeleteConnection ¶
func (Database) DeleteMfilter ¶
func (Database) GetCachedSetting ¶
func (db Database) GetCachedSetting(chat_id int64) *ChatSettings
func (Database) GetMfilter ¶
func (Database) RecacheSettings ¶
func (Database) SaveMfilter ¶
func (Database) SetChatSetting ¶
func (Database) SetDefaultSettings ¶
func (Database) StartGfilter ¶
func (Database) StopGfilter ¶
func (Database) StringMfilter ¶
type Filter ¶
type Filter struct { //Unique id of the filter Id string `bson:"_id"` //Chat where the filter is in effect ChatId int64 `bson:"group_id"` //The key/text which is filtered Text string `bson:"text"` //The text content/caption saved Content string `bson:"content"` //The id of a media saved for the filter if any FileID string `bson:"file"` //Buttons/markup saved for a filter if any Markup [][]map[string]string `bson:"button"` //Alerts saved for a filter if any Alerts []string `bson:"alert"` //Length of the text according to which filters are sorted Length int `bson:"length"` //Type of media saved if any MediaType string `bson:"mediaType"` }
Click to show internal directories.
Click to hide internal directories.