Documentation ¶
Index ¶
- Constants
- Variables
- func RecordDiscordRequestsByCounts(client *redis.Client, counts task.MuteDeafenSuccessCounts)
- type TokenProvider
- func (tokenProvider *TokenProvider) BlacklistTokenForDuration(guildID, hashToken string, duration time.Duration) error
- func (tokenProvider *TokenProvider) Close()
- func (tokenProvider *TokenProvider) IncrAndTestGuildTokenComboLock(guildID, hashToken string) bool
- func (tp *TokenProvider) Init(client *redis.Client, sess *discordgo.Session)
- func (tokenProvider *TokenProvider) ModifyUsers(guildID, connectCode string, request task.UserModifyRequest, ...) error
- func (tokenProvider *TokenProvider) PopulateAndStartSessions(tokens []string)
Constants ¶
View Source
const DefaultMaxWorkers = 8
Variables ¶
View Source
var PremiumBotConstraints = map[premium.Tier]int{
0: 0,
1: 0,
2: 1,
3: 3,
4: 10,
5: 100,
}
View Source
var UnresponsiveCaptureBlacklistDuration = time.Minute * time.Duration(5)
Functions ¶
func RecordDiscordRequestsByCounts ¶
func RecordDiscordRequestsByCounts(client *redis.Client, counts task.MuteDeafenSuccessCounts)
Types ¶
type TokenProvider ¶
type TokenProvider struct {
// contains filtered or unexported fields
}
func NewTokenProvider ¶
func (*TokenProvider) BlacklistTokenForDuration ¶
func (tokenProvider *TokenProvider) BlacklistTokenForDuration(guildID, hashToken string, duration time.Duration) error
BlacklistTokenForDuration sets a guild token (or connect code ala capture bot) to the maximum value allowed before attempting other non-rate-limited mute/deafen methods. NOTE: this will manifest as the capture/token in question appearing like it "has been used <maxnum> times" in logs, even if this is not technically accurate. A more accurate approach would probably use a totally separate Redis key, as opposed to this approach, which simply uses the ratelimiting counter key(s) to achieve blacklisting
func (*TokenProvider) Close ¶
func (tokenProvider *TokenProvider) Close()
func (*TokenProvider) IncrAndTestGuildTokenComboLock ¶
func (tokenProvider *TokenProvider) IncrAndTestGuildTokenComboLock(guildID, hashToken string) bool
func (*TokenProvider) Init ¶
func (tp *TokenProvider) Init(client *redis.Client, sess *discordgo.Session)
func (*TokenProvider) ModifyUsers ¶
func (tokenProvider *TokenProvider) ModifyUsers(guildID, connectCode string, request task.UserModifyRequest, voicelock *redislock.Lock) error
func (*TokenProvider) PopulateAndStartSessions ¶
func (tokenProvider *TokenProvider) PopulateAndStartSessions(tokens []string)
Click to show internal directories.
Click to hide internal directories.