usersDatabase

package
v0.0.0-...-1fee9d7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModelBlockedUser = &BlockedUser{}
	BLockedUserEmpty = &BlockedUser{}
)

database models

Functions

func BlockUser

func BlockUser(userId int64)

func GetUserFromMessageId

func GetUserFromMessageId(messageId int64) int64

func IsUserBlocked

func IsUserBlocked(userId int64) bool

func SetUserFromMessageId

func SetUserFromMessageId(messageId int64, user *gotgbot.User)

Types

type BlockedUser

type BlockedUser struct {
	UserId    string    `json:"user_id" gorm:"primaryKey"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (*BlockedUser) IsExpired

func (b *BlockedUser) IsExpired(expirationDuration time.Duration) bool

func (*BlockedUser) IsValid

func (b *BlockedUser) IsValid(expirationDuration time.Duration) bool

Jump to

Keyboard shortcuts

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