9191from .stage_instance import StageInstance
9292from .sticker import GuildSticker
9393from .threads import Thread , ThreadMember
94+ from .types .voice import VoiceRegion as VoiceRegionData
9495from .user import User
9596from .utils import _D , _FETCHABLE
9697from .welcome_screen import WelcomeScreen , WelcomeScreenChannel
121122 from .types .guild import ModifyIncidents as ModifyIncidentsPayload
122123 from .types .member import Member as MemberPayload
123124 from .types .threads import Thread as ThreadPayload
124- from .types .voice import VoiceRegion as VoiceRegionPayload
125125 from .types .voice import VoiceState as GuildVoiceState
126126 from .voice import VoiceClient
127127 from .webhook import Webhook
@@ -3797,7 +3797,7 @@ async def vanity_invite(self) -> Invite | None:
37973797 payload ["uses" ] = payload .get ("uses" , 0 )
37983798 return Invite (state = self ._state , data = payload , guild = self , channel = channel )
37993799
3800- async def fetch_voice_regions (self ) -> list [VoiceRegionPayload ]:
3800+ async def fetch_voice_regions (self ) -> list [VoiceRegionData ]:
38013801 """|coro|
38023802
38033803 Retrieves the voice regions that the guild has access to.
@@ -3806,19 +3806,18 @@ async def fetch_voice_regions(self) -> list[VoiceRegionPayload]:
38063806 recommended way to get the currently available regions.
38073807 .. versionadded:: 2.9
38083808
3809- Each payload is a :class:`~discord.types.voice.VoiceRegion` TypedDict
3810- with the following keys:
3809+ Each :class:`~discord.types.voice.VoiceRegion` has the following attributes:
38113810
3812- ``id` `
3811+ :attr:`~discord.types.voice.VoiceRegion.id `
38133812 The region ID, e.g. ``"us-west"``. Use this as the
38143813 :attr:`~discord.VoiceChannel.rtc_region` of a voice channel.
3815- `` name` `
3814+ :attr:`~discord.types.voice.VoiceRegion. name`
38163815 The region's display name, e.g. ``"US West"``.
3817- `` optimal` `
3816+ :attr:`~discord.types.voice.VoiceRegion. optimal`
38183817 Whether the region is optimal for the guild's members.
3819- `` deprecated` `
3818+ :attr:`~discord.types.voice.VoiceRegion. deprecated`
38203819 Whether the region is deprecated.
3821- `` custom` `
3820+ :attr:`~discord.types.voice.VoiceRegion. custom`
38223821 Whether the region is a custom region.
38233822
38243823 Returns
@@ -3831,7 +3830,8 @@ async def fetch_voice_regions(self) -> list[VoiceRegionPayload]:
38313830 HTTPException
38323831 Retrieving the voice regions failed.
38333832 """
3834- return await self ._state .http .get_guild_voice_regions (self .id )
3833+ regions = await self ._state .http .get_guild_voice_regions (self .id )
3834+ return [VoiceRegionData (** region ) for region in regions ]
38353835
38363836 # TODO: use MISSING when async iterators get refactored
38373837 def audit_logs (
0 commit comments