mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
feat(handlers): add getAvailableVoiceRegions() (#425)
* add voice endpoint * feat(handlers): add getVoiceRegions * Update mod.ts * remove breaking changes
This commit is contained in:
@@ -729,6 +729,11 @@ export function leaveGuild(guildID: string) {
|
||||
return RequestManager.delete(endpoints.GUILD_LEAVE(guildID));
|
||||
}
|
||||
|
||||
/** Returns an array of voice regions that can be used when creating servers. */
|
||||
export function getAvailableVoiceRegions() {
|
||||
return RequestManager.get(endpoints.VOICE_REGIONS);
|
||||
}
|
||||
|
||||
/** Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled. */
|
||||
export function getVoiceRegions(guildID: string) {
|
||||
return RequestManager.get(endpoints.GUILD_REGIONS(guildID));
|
||||
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
emojiURL,
|
||||
fetchMembers,
|
||||
getAuditLogs,
|
||||
getAvailableVoiceRegions,
|
||||
getBan,
|
||||
getBans,
|
||||
getChannel,
|
||||
@@ -171,6 +172,7 @@ export let handlers = {
|
||||
getGuildPreview,
|
||||
getGuildTemplate,
|
||||
getGuildTemplates,
|
||||
getAvailableVoiceRegions,
|
||||
getIntegrations,
|
||||
getInvites,
|
||||
getMember,
|
||||
|
||||
@@ -117,6 +117,9 @@ export const endpoints = {
|
||||
GUILD_TEMPLATES: (guildID: string) => `${GUILDS_BASE(guildID)}/templates`,
|
||||
GUILD_PREVIEW: (guildID: string) => `${GUILDS_BASE(guildID)}/preview`,
|
||||
|
||||
// Voice
|
||||
VOICE_REGIONS: `${baseEndpoints.BASE_URL}/voice/regions`,
|
||||
|
||||
INVITE: (inviteCode: string) =>
|
||||
`${baseEndpoints.BASE_URL}/invites/${inviteCode}`,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user