Skip to content

Commit

Permalink
whoopsie doopsie :3 nya
Browse files Browse the repository at this point in the history
  • Loading branch information
MagM1go committed Sep 18, 2024
1 parent 80a1af7 commit ede50ee
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/main/kotlin/top/boticord/BotiCordClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,37 @@ public class BotiCordClient(

websockets.listen { block(it) }
}

@OptIn(DelicateCoroutinesApi::class)
public suspend fun autopost(
botId: Long,
memberCount: Int?,
shardCount: Int? = null,
guildCount: Int? = null
) {
GlobalScope.launch {
while (isActive) {
update(botId, memberCount, shardCount, guildCount)
delay(10_000L)
}
}
}

@OptIn(DelicateCoroutinesApi::class)
public suspend fun autopost(
scope: CoroutineScope = GlobalScope,
botId: Long,
memberCount: Int?,
shardCount: Int? = null,
guildCount: Int? = null
) {
scope.launch {
while (isActive) {
update(botId, memberCount, shardCount, guildCount)
delay(10_000L)
}
}
}
}

public suspend fun <T> boticord(
Expand Down

0 comments on commit ede50ee

Please sign in to comment.