summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-10-17 10:35:47 +0200
committerRory& <root@rory.gay>2026-10-17 10:35:47 +0200
commit0a04fdd91fd5c5fa48fac6787b6be43f4d6257c7 (patch)
tree5aea2d073a68acec9240b58935224a59d0cc0c1f /src/api
parentVoiceStateUpdate: coalesce empty channel/guild ids to undefined (diff)
downloadserver-ts-0a04fdd91fd5c5fa48fac6787b6be43f4d6257c7.tar.xz
Allow null guild/channel ids for voice states
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts b/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts

index a8df4a2e4..2ee777fb0 100644 --- a/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts +++ b/src/api/routes/guilds/#guild_id/voice-states/#user_id/index.ts
@@ -47,7 +47,7 @@ router.patch( const { guild_id } = req.params as { [key: string]: string }; const user_id = req.params.user_id === "@me" ? req.user_id : (req.params.user_id as string); - const perms = await getPermission(req.user_id, guild_id, body.channel_id); + const perms = await getPermission(req.user_id, guild_id, body.channel_id!); /* From https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state @@ -63,7 +63,7 @@ router.patch( const voiceState = await VoiceState.findOne({ where: { guild_id, - channel_id: body.channel_id, + channel_id: body.channel_id!, user_id, }, }); @@ -71,7 +71,7 @@ router.patch( voiceState.assign(body); const channel = await Channel.findOneOrFail({ - where: { guild_id, id: body.channel_id }, + where: { guild_id, id: body.channel_id! }, }); if (channel.type !== ChannelType.GUILD_STAGE_VOICE) { throw DiscordApiErrors.CANNOT_EXECUTE_ON_THIS_CHANNEL_TYPE; @@ -80,7 +80,7 @@ router.patch( voiceState.member = await Member.findOneOrFail({ where: { id: voiceState.user_id, - guild_id: voiceState.guild_id, + guild_id: voiceState.guild_id!, }, });