mongo

package
v0.0.0-...-b986d7c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConnection

func CloseConnection()

func CountMessagesOfPlayer

func CountMessagesOfPlayer(name string) (int32, error)

func ExpiredWarnings

func ExpiredWarnings() (<-chan model.Warning, error)

func Init

func Init() error

func InsertDiscordMessage

func InsertDiscordMessage(ctx context.Context, message *discordgo.Message) error

func InsertMessage

func InsertMessage(message *discordgo.Message) error

func InsertMute

func InsertMute(mute *model.Mute) error

func InsertUnMute

func InsertUnMute(unmute *model.Unmute) error

func InsertWarning

func InsertWarning(warning *model.Warning) error

func SearchByDiscordTag

func SearchByDiscordTag(discordTag string) (*model.User, error)

func UserById

func UserById(ctx context.Context, id int) (*model.User, error)

func UsersByDiscordAccount

func UsersByDiscordAccount(ctx context.Context, user *discordgo.User) ([]*model.User, error)

UserByDiscordAccount returns the user with the given discord account it searches by the discord id, if the id exists it returns the user if the id does not exist it searches by the discord tag

func UsersByDiscordId

func UsersByDiscordId(ctx context.Context, id string) ([]*model.User, error)

func UsersByDiscordTag

func UsersByDiscordTag(ctx context.Context, tag string) ([]*model.User, error)

func WarningsByUser

func WarningsByUser(user *discordgo.Member) ([]*model.Warning, error)

Types

type ChatMessage

type ChatMessage struct {
	UUID       string    `bson:"uuid,omitempty" json:"uuid"`
	Name       string    `bson:"name,omitempty" json:"name"`
	Prefix     string    `bson:"prefix,omitempty" json:"prefix"`
	Message    string    `bson:"message,omitempty" json:"message"`
	ClientName string    `bson:"client_name,omitempty" json:"clientName"`
	Timestamp  time.Time `bson:"timestamp,omitempty" json:"timestamp"`
}

type UserNotFoundError

type UserNotFoundError struct {
	UserId int
}

Jump to

Keyboard shortcuts

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