diff --git a/litecord/storage.py b/litecord/storage.py index 3f9b77d..0125817 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -432,7 +432,7 @@ class Storage: return {**row, **drow} elif chan_type == ChannelType.GUILD_VOICE: - vrow = await self.db.fetchrow( + voice_channel_data = await self.db.fetchrow( """ SELECT bitrate, user_limit FROM guild_voice_channels @@ -441,7 +441,20 @@ class Storage: row["id"], ) - return {**row, **dict(vrow)} + guild_region = await self.db.fetchval( + """ + SELECT region + FROM guilds + WHERE guild.id = $1 + """, + guild_id, + row["guild_id"], + ) + + # see https://gitlab.com/litecord/litecord/-/issues/130 + voice_channel_data["rtc_region"] = guild_region + + return {**row, **dict(voice_channel_data)} else: # this only exists to trick mypy. this codepath is unreachable raise AssertionError("Unreachable code path.")