storage

package
v0.0.0-...-fe6737b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CHAT = "CHAT_"
View Source
const USER = "USER_"

Variables

This section is empty.

Functions

func AppendRequest

func AppendRequest(c int64, u int64) (result *mongo.UpdateResult, err error)

func DelChat

func DelChat(c *Chat) error

func GetChat

func GetChat(c *Chat, id int64) error

func GetUserLocale

func GetUserLocale(r tele.Recipient) string

func IsManager

func IsManager(id int64) bool

func NewUser

func NewUser(user *tele.User, role string, state string) error

func RemoveRequest

func RemoveRequest(c int64, u int64) (result *mongo.UpdateResult, err error)

func SetUserLocale

func SetUserLocale(user *tele.User, locale string) error

Types

type Chat

type Chat struct {
	db.DateFields `bson:",inline"`
	ID            string  `json:"id" bson:"_id,omitempty"`
	Owner         string  `json:"owner" bson:"owner"`
	Requests      []int64 `json:"requests" bson:"requests"`
}

func NewChat

func NewChat(id int64, owner int64) *Chat

func (*Chat) GetID

func (m *Chat) GetID() interface{}

func (*Chat) PrepareID

func (m *Chat) PrepareID(id interface{}) (interface{}, error)

func (*Chat) SetID

func (m *Chat) SetID(id interface{})

type User

type User struct {
	db.DateFields `bson:",inline"`
	ID            string `json:"id" bson:"_id,omitempty"`
	Role          string `json:"role" bson:"role"`
	State         string `json:"state" bson:"state"`
	Locale        string `json:"language_code" bson:"language_code"`
}

func GetUser

func GetUser(user tele.Recipient) (*User, error)

func (*User) GetID

func (m *User) GetID() interface{}

func (*User) PrepareID

func (m *User) PrepareID(id interface{}) (interface{}, error)

func (*User) SetID

func (m *User) SetID(id interface{})

Jump to

Keyboard shortcuts

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