(command)
| 60 | } |
| 61 | |
| 62 | function getAnomalyPolicy(command) { |
| 63 | const anomaly = command?.abuseProtection?.anomaly || {}; |
| 64 | const threshold = Number.isInteger(anomaly.threshold) && anomaly.threshold > 0 |
| 65 | ? anomaly.threshold |
| 66 | : DEFAULT_ANOMALY_POLICY.threshold; |
| 67 | const windowMs = Number.isInteger(anomaly.windowMs) && anomaly.windowMs > 0 |
| 68 | ? anomaly.windowMs |
| 69 | : DEFAULT_ANOMALY_POLICY.windowMs; |
| 70 | |
| 71 | return { threshold, windowMs }; |
| 72 | } |
| 73 | |
| 74 | function getProtectionKey(interaction, commandName) { |
| 75 | const guildScope = interaction.guildId || 'dm'; |
no outgoing calls
no test coverage detected