File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -628,17 +628,26 @@ protected function getStageInstancesAttribute(): ExCollectionInterface
628628 }
629629
630630 /**
631- * Gets the voice regions available.
631+ * Returns a list of voice region objects for the guild.
632+ *
633+ * Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.
632634 *
633- * @link https://discord.com/developers/docs/ resources/voice#list -voice-regions
635+ * @link https://docs. discord.com/developers/resources/guild#get-guild -voice-regions
634636 *
635637 * @return PromiseInterface<ExCollectionInterface<Region>|Region[]>
636- *
637- * @deprecated 10.23.0 Use `Discord::listVoiceRegions` instead.
638638 */
639639 public function getVoiceRegions (): PromiseInterface
640640 {
641- return $ this ->discord ->listVoiceRegions ();
641+ return $ this ->http ->get (Endpoint::bind (Endpoint::GUILD_REGIONS , $ this ->id ))->then (function ($ response ) {
642+ /** @var ExCollectionInterface<Region> $regions */
643+ $ regions = $ this ->discord ->getCollectionClass ()::for (Region::class);
644+
645+ foreach ($ response as $ region ) {
646+ $ regions ->pushItem ($ this ->factory ->part (Region::class, (array ) $ region , true ));
647+ }
648+
649+ return $ regions ;
650+ });
642651 }
643652
644653 /**
You can’t perform that action at this time.
0 commit comments