Documentation
¶
Index ¶
- Constants
- func IncrementRateLimitExceed(client *redis.Client, userID string) bool
- func IsUserBanned(client *redis.Client, userID string) bool
- func IsUserRateLimitedGeneral(client *redis.Client, userID string) bool
- func IsUserRateLimitedSpecific(client *redis.Client, userID string, cmdType string) bool
- func MarkUserRateLimit(client *redis.Client, userID, cmdType string, ttl time.Duration)
- func UserRateLimitGeneralKey(userID string) string
- func UserRateLimitSpecificKey(userID, cmdType string) string
- func UserSoftbanCountKey(userID string) string
- func UserSoftbanKey(userID string) string
Constants ¶
View Source
const GlobalUserRateLimitDuration = 1 * time.Second
View Source
const NewGameRateLimitDuration = 3000 * time.Millisecond
View Source
const ReactionRateLimitDuration = 3000 * time.Millisecond
View Source
const SoftbanDuration = 5 * time.Minute
when a user exceeds the threshold, they're ignored for this long
View Source
const SoftbanExpiration = 10 * time.Minute
how far back the bot should look for violations. Softban is invoked by violations>threshold in this amt of time
View Source
const SoftbanThreshold = 3
how many violations before a softban
Variables ¶
This section is empty.
Functions ¶
func IsUserBanned ¶
func MarkUserRateLimit ¶
func UserRateLimitGeneralKey ¶
func UserSoftbanCountKey ¶
func UserSoftbanKey ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.