@@ -21,6 +21,7 @@ import com.lambda.Lambda
2121import com.lambda.Lambda.LOG
2222import com.lambda.context.SafeContext
2323import com.lambda.event.EventFlow
24+ import com.lambda.event.events.TickEvent
2425import com.lambda.event.events.WorldEvent
2526import com.lambda.event.listener.SafeListener.Companion.listenOnce
2627import com.lambda.module.Module
@@ -61,26 +62,22 @@ object Discord : Module(
6162 var discordAuth: AuthenticatePacket .Data ? = null ; private set
6263
6364 init {
64- listenOnce<WorldEvent .Join > {
65- if (rpc.connected) return @listenOnce false
66-
67- runConcurrent {
68- start()
69- handleLoop()
70- }
65+ // ts is fucked frfr
66+ listenOnce<TickEvent .Pre > {
67+ runConcurrent { handleLoop() }
7168
7269 return @listenOnce true
7370 }
7471
75- onEnable { runConcurrent { start(); handleLoop() } }
72+ onEnable { runConcurrent { start() } }
73+ runConcurrent { start() }
7674 onDisable { stop() }
7775 }
7876
7977 private suspend fun start () {
8078 if (rpc.connected) return
8179
82- runConcurrent { rpc.connect() }
83- delay(1000 )
80+ rpc.connect()
8481
8582 val auth = rpc.applicationManager.authenticate()
8683
@@ -107,7 +104,7 @@ object Discord : Module(
107104
108105 largeImage(" lambda" , Lambda .VERSION )
109106 smallImage(" https://mc-heads.net/avatar/${mc.gameProfile.id} /nohelm" , mc.gameProfile.name)
110- button(" Download" , " https://github.com/lambda-client/lambda" )
107+ // button("Download", "https://github.com/lambda-client/lambda")
111108
112109 if (showTime) timestamps(startup)
113110 }
0 commit comments