Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e69b2e8
commit e0d01b6
Showing
3 changed files
with
55 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 15 additions & 3 deletions
18
latte/src/main/java/gg/beemo/latte/ratelimit/SharedRatelimitData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
package gg.beemo.latte.ratelimit | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
object SharedRatelimitData { | ||
|
||
const val RATELIMIT_TOPIC = "ratelimit" | ||
|
||
const val KEY_REQUEST_IDENTIFY_QUOTA = "quota.identify.request" | ||
const val KEY_REQUEST_GLOBAL_QUOTA = "quota.global.request" | ||
const val KEY_REQUEST_QUOTA = "quota.request" | ||
|
||
@JsonClass(generateAdapter = true) | ||
class RatelimitClientData(val discordClientId: String?, val requestExpiresAt: Long? = null) | ||
class RatelimitRequestData( | ||
val type: RatelimitType, | ||
val discordClientId: String?, | ||
val requestExpiresAt: Long? = null, | ||
) | ||
|
||
enum class RatelimitType { | ||
@Json(name = "global") | ||
GLBOAL, | ||
|
||
@Json(name = "identify") | ||
IDENTIFY, | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters