db

package
v0.0.0-...-89cdaf4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertUserStatus

func InsertUserStatus(discordUserId, discordChannelId, intervalTime int64) error

Types

type Activity

type Activity struct {
	gorm.Model
	DiscordUserId int64
	Kind          uint32
}

func FetchTodayActivities

func FetchTodayActivities(discordUserlIdStr string, kind ActivityKind) ([]*Activity, error)

func InsertActivity

func InsertActivity(discordUserlIdStr string, kind ActivityKind) (*Activity, error)

type ActivityKind

type ActivityKind uint32
const (
	ActivityKindBattlePower         ActivityKind = 1
	ActivityKindFoodPorn            ActivityKind = 2
	ActivityKindFortune             ActivityKind = 3
	ActivityKindInsiderGame         ActivityKind = 4
	ActivityKindInteractionCreate   ActivityKind = 5
	ActivityKindInteractionDestroy  ActivityKind = 6
	ActivityKindInteractionResponse ActivityKind = 7
	ActivityKindInteractionList     ActivityKind = 8
	ActivityKindLuckyColor          ActivityKind = 9
	ActivityKindNickname            ActivityKind = 10
	ActivityKindTalk                ActivityKind = 11
	ActivityKindWeapon              ActivityKind = 12
	ActivityKindWeather             ActivityKind = 13
	ActivityKindLottery             ActivityKind = 14
)

type Channel

type Channel struct {
	gorm.Model
	DiscordChannelId int64
	DiscordGuildId   int64
	Name             string
}

func FindChannel

func FindChannel(discordChannelId int64) (*Channel, error)

func FindOrCreateChannel

func FindOrCreateChannel(discordChannelId, discordGuildId int64, name string) (*Channel, error)

type User

type User struct {
	gorm.Model
	DiscordUserId int64
	Name          string
}

func FindOrCreateUser

func FindOrCreateUser(discordUserIdStr string, name string) (*User, error)

func FindUser

func FindUser(discordUserIdStr string) (*User, error)

type UserStatus

type UserStatus struct {
	gorm.Model
	DiscordUserId    int64
	DiscordChannelId int64
	IntervalTime     int64
}

Jump to

Keyboard shortcuts

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