Skip to content

Commit 0054154

Browse files
committed
Voice server update endpoint is nullable
discord/discord-api-docs#1741
1 parent fa7e8fd commit 0054154

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

common/src/main/kotlin/com/gitlab/kordlib/common/entity/DiscordGuild.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,20 @@ data class DiscordIntegrationAccount(
304304
)
305305

306306

307+
/**
308+
* @param token The voice connection token.
309+
* @param guildId The guild id this server update is for.
310+
* @param endpoint The voice server host.
311+
* A null endpoint means that the voice server allocated has gone away and is trying to be reallocated.
312+
* You should attempt to disconnect from the currently connected voice server,
313+
* and not attempt to reconnect until a new voice server is allocated.
314+
*/
307315
@Serializable
308316
data class DiscordVoiceServerUpdateData(
309317
val token: String,
310318
@SerialName("guild_id")
311319
val guildId: Snowflake,
312-
val endpoint: String,
320+
val endpoint: String?,
313321
)
314322

315323
@Serializable

core/src/main/kotlin/com/gitlab/kordlib/core/event/guild/VoiceServerUpdateEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import com.gitlab.kordlib.core.supplier.EntitySupplyStrategy
1212
class VoiceServerUpdateEvent(
1313
val token: String,
1414
val guildId: Snowflake,
15-
val endpoint: String,
15+
val endpoint: String?,
1616
override val kord: Kord,
1717
override val shard: Int,
1818
override val supplier: EntitySupplier = kord.defaultSupplier

0 commit comments

Comments
 (0)