Documentation
¶
Index ¶
- Constants
- Variables
- func ChangeUserReportsResolvedCount(userID string, change int) error
- func ChangeUserReputation(userID string, change int) error
- func ConnectMongo(mongoUri, mongoDatabaseName string)
- func CreateWarning(warn Warning) error
- func DeleteExpiredUserWarnings(userID string) error
- func DeleteExpiredWarnings() (int64, error)
- func IncrementUserMuteCount(userID string) error
- func IncrementUserReportsSentCount(userID string) error
- func RemoveUser(userID string) error
- func RemoveUserWarnings(userID string) error
- func ResetUserMuteCount(userID string) error
- func ResetUserReputationDelay(userID string) error
- func SetUserReputation(userID string, reputation int) error
- func UpdateGuild(server Guild) error
- func UpdateUserBanDelay(userID string) error
- func UpdateUserReputationDelay(userID string) error
- type Guild
- type User
- type Warning
Constants ¶
View Source
const ( UserCollectionName = "users" ReputationDelay = 40 * time.Minute BanDelay = 3 * time.Hour DefaultReputation = 0 )
View Source
const ( WarningCollectionName = "warnings" WarningDuration = 36 * time.Hour )
View Source
const GuildCollectionName = "guilds"
Variables ¶
View Source
var ( MongoClient *mongo.Client MongoDatabase *mongo.Database )
View Source
var ( MaxReputation float64 = 1000000 MinReputation float64 = -1000000 )
Functions ¶
func ChangeUserReputation ¶
func ConnectMongo ¶
func ConnectMongo(mongoUri, mongoDatabaseName string)
func CreateWarning ¶
func DeleteExpiredWarnings ¶
func IncrementUserMuteCount ¶
func RemoveUser ¶
func RemoveUserWarnings ¶
func ResetUserMuteCount ¶
func SetUserReputation ¶
func UpdateGuild ¶
func UpdateUserBanDelay ¶
Types ¶
type Guild ¶
type Guild struct { ID string `bson:"id,omitempty"` SupremeModeratorRoleID string `bson:"supremeModeratorRoleID,omitempty"` ReportChannelID string `bson:"reportChannelId,omitempty"` ResoledReportChannelID string `bson:"resoledReportChannelId,omitempty"` ReputationLogChannelID string `bson:"reputationLogChannelId,omitempty"` ModerationLogChannelID string `bson:"moderationLogChannelId,omitempty"` }
type User ¶
type User struct { ID string `bson:"id,omitempty"` Reputation int `bson:"reputation,omitempty"` ReputationDelay time.Time `bson:"reputationDelayEnd,omitempty"` BanDelay time.Time `bson:"banDelayEnd,omitempty"` ReportsSentCount int `bson:"reportsSentCount,omitempty"` ReportsResolvedCount int `bson:"reportsResolvedCount,omitempty"` MuteCount int `bson:"muteCount,omitempty"` LastMuteTime time.Time `bson:"lastMuteTime,omitempty"` }
func GetUserReputationTop ¶
Click to show internal directories.
Click to hide internal directories.