common

package
v7.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalUserRateLimitDuration = 1 * time.Second
View Source
const GuildDownloadCooldown = 24 * time.Hour
View Source
const NewGameRateLimitDuration = 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 GetDownloadCategoryCooldown

func GetDownloadCategoryCooldown(client *redis.Client, guildID, category string) (time.Duration, error)

func GuildDownloadCategoryCooldownKey

func GuildDownloadCategoryCooldownKey(guildID, category string) string

func IncrementRateLimitExceed

func IncrementRateLimitExceed(client *redis.Client, userID string) bool

func IsUserBanned

func IsUserBanned(client *redis.Client, userID string) bool

func IsUserRateLimitedGeneral

func IsUserRateLimitedGeneral(client *redis.Client, userID string) bool

func IsUserRateLimitedSpecific

func IsUserRateLimitedSpecific(client *redis.Client, userID string, cmdType string) bool

func MarkDownloadCategoryCooldown

func MarkDownloadCategoryCooldown(client *redis.Client, guildID, category string)

func MarkUserRateLimit

func MarkUserRateLimit(client *redis.Client, userID, cmdType string, ttl time.Duration)

func UserRateLimitGeneralKey

func UserRateLimitGeneralKey(userID string) string

func UserRateLimitSpecificKey

func UserRateLimitSpecificKey(userID, cmdType string) string

func UserSoftbanCountKey

func UserSoftbanCountKey(userID string) string

func UserSoftbanKey

func UserSoftbanKey(userID string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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