Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
View Source
var ErrNoSqid = errors.New("no sqid could be decoded")
Functions ¶
func DeleteInfractionBySqid ¶
func SetGuildSettings ¶
func SetGuildSettings(settings *GuildSettings) error
Types ¶
type GuildSettings ¶
type GuildSettings struct { GuildID snowflake.ID `gorm:"primaryKey;autoIncrement:false"` UpdatedAt time.Time `gorm:"autoUpdateTime"` // ModeratorChannel is the channel where notifications and other // information for moderators and administrators are sent. ModeratorChannel snowflake.ID // InfractionHalfLifeDays is the half-life time of infractions in days. InfractionHalfLifeDays float64 NotifyOnWarnedUserJoin bool NotifyWarnSeverityThreshold float64 `gorm:"default:1.0"` GatekeepEnabled bool GatekeepPendingRole snowflake.ID GatekeepApprovedRole snowflake.ID GatekeepAddPendingRoleOnJoin bool GatekeepApprovedMessage string JoinMessageEnabled bool JoinMessage string LeaveMessageEnabled bool LeaveMessage string JoinLeaveChannel snowflake.ID AntiSpamEnabled bool AntiSpamCount int `gorm:"default:5"` AntiSpamCooldownSeconds int `gorm:"default:20"` }
func GetGuildSettings ¶
func GetGuildSettings(guildID snowflake.ID) (*GuildSettings, error)
type Infraction ¶
type Infraction struct { gorm.Model GuildID snowflake.ID UserID snowflake.ID Moderator snowflake.ID Reason string Weight float64 Timestamp time.Time Silent bool }
func CreateInfraction ¶
func CreateInfraction(guildID, userID, moderator snowflake.ID, reason string, weight float64, silent bool) (*Infraction, error)
func GetUserInfractions ¶
func GetUserInfractions(guildID, userID snowflake.ID, limit, offset int) ([]Infraction, int64, error)
func (Infraction) Sqid ¶
func (i Infraction) Sqid() string
type TempBan ¶
type TempBan struct { GuildID snowflake.ID `gorm:"primaryKey;autoIncrement:false"` UserID snowflake.ID `gorm:"primaryKey;autoIncrement:false"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` Reason string Banner snowflake.ID Until time.Time }
func CreateTempBan ¶
func GetExpiredTempBans ¶
func GetTempBan ¶
func GetTempBans ¶
Click to show internal directories.
Click to hide internal directories.