mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
refactor!: move dirs outside of src/ (#2032)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import type { VoiceRegion } from "../../types/voice/voiceRegion.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
|
||||
/** Returns an array of voice regions that can be used when creating servers. */
|
||||
export async function getAvailableVoiceRegions(bot: Bot) {
|
||||
const result = await bot.rest.runMethod<VoiceRegion[]>(bot.rest, "get", bot.constants.endpoints.VOICE_REGIONS);
|
||||
|
||||
return new Collection(
|
||||
result.map((region) => {
|
||||
const voiceRegion = bot.transformers.voiceRegion(bot, region);
|
||||
return [voiceRegion.id, voiceRegion];
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user