Skip to content

Changed the DiscordRPC delay from seconds to ms #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object DiscordRPC : Module(
private val line2Left by setting("Line 2 Left", LineInfo.DIMENSION) // state left
private val line2Right by setting("Line 2 Right", LineInfo.HEALTH) // state right
private val coordsConfirm by setting("Coords Confirm", false, { showCoordsConfirm() })
private val delay by setting("Update Delay", 5, 1..60, 1, unit = " s")
private val delay by setting("Update Delay", 200, 200..2000, 1, unit = "ms")

private enum class LineInfo {
VERSION, WORLD, DIMENSION, USERNAME, HEALTH, HUNGER, SERVER_IP, COORDS, SPEED, HELD_ITEM, FPS, TPS, NONE
Expand All @@ -46,8 +46,8 @@ object DiscordRPC : Module(
private var initialised = false
private val rpcBuilder = RichPresence.Builder()
.setLargeImage("default", "https://github.com/lambda-client/lambda/")
private val timer = TickTimer(TimeUnit.SECONDS)
private val job = BackgroundJob("Discord RPC", { delay * 1000L }) { updateRPC() }
private val timer = TickTimer(TimeUnit.MILLISECONDS)
private val job = BackgroundJob("Discord RPC", { delay * 200L }) { updateRPC() }

init {
onEnable {
Expand Down