Documentation
¶
Index ¶
- Variables
- func AddMembersToBePruned(pruneID uuid.UUID, members []discord.Member) error
- func DeleteInfractionBySqid(sqid string) error
- func DeletePrunesBeforeTime(t time.Time) error
- func InitDB(path string) (*gorm.DB, error)
- func IsMemberPruned(guildID, userID snowflake.ID) (bool, error)
- func RemoveMembersByPruneID(pruneID uuid.UUID, guildID snowflake.ID) error
- func RemovePrunedMembers(guildID snowflake.ID) error
- func SetGuildSettings(settings *GuildSettings) error
- func SetMemberPruned(guildID snowflake.ID, userID snowflake.ID, pruned bool) error
- func SetModmailSettings(settings *ModmailSettings) error
- type GuildSettings
- type Infraction
- type MemberPendingPrune
- type ModmailSettings
- type TempBan
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 AddMembersToBePruned ¶
func DeleteInfractionBySqid ¶
func DeletePrunesBeforeTime ¶
func RemoveMembersByPruneID ¶
func RemovePrunedMembers ¶
func SetGuildSettings ¶
func SetGuildSettings(settings *GuildSettings) error
func SetMemberPruned ¶
func SetModmailSettings ¶
func SetModmailSettings(settings *ModmailSettings) 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 GetUserInfractions ¶
func (Infraction) Sqid ¶
func (i Infraction) Sqid() string
type MemberPendingPrune ¶
type MemberPendingPrune struct {
GuildID snowflake.ID `gorm:"primaryKey;autoIncrement:false"`
PruneID uuid.UUID `gorm:"primaryKey;autoIncrement:false"`
UserID snowflake.ID `gorm:"primaryKey;autoIncrement:false"`
Timestamp time.Time `gorm:"autoCreateTime;index"`
Pruned bool `gorm:"default:false"`
}
func GetMembersToPrune ¶
func GetPrunedMembers ¶
type ModmailSettings ¶
type ModmailSettings struct {
GuildID snowflake.ID `gorm:"primaryKey;autoIncrement:false"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
ReportThreadsChannel snowflake.ID
ReportNotificationChannel snowflake.ID
ReportPingRole snowflake.ID
}
func GetModmailSettings ¶
func GetModmailSettings(guildID snowflake.ID) (*ModmailSettings, error)
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 ¶
Click to show internal directories.
Click to hide internal directories.