diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index fc2b80c9a..70492fd49 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -1,5 +1,9 @@ import type { RawFile } from '@discordjs/rest'; import { makeURLSearchParams, type REST } from '@discordjs/rest'; +import type { + RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, + RESTPatchAPIGuildVoiceStateCurrentMemberResult, +} from 'discord-api-types/v10'; import { Routes, type GuildMFALevel, @@ -976,4 +980,17 @@ export class GuildsAPI { public async getWebhooks(id: Snowflake) { return this.rest.get(Routes.guildWebhooks(id)) as Promise; } + + /** + * Sets the voice state for the current user + * + * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state} + * @param guildId - The id of the guild + * @param options - The options to use when setting the voice state + */ + public async setVoiceState(guildId: Snowflake, options: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = {}) { + return this.rest.patch(Routes.guildVoiceState(guildId, '@me'), { + body: options, + }) as Promise; + } } diff --git a/packages/core/src/api/user.ts b/packages/core/src/api/user.ts index 26d83acf3..8280b51e3 100644 --- a/packages/core/src/api/user.ts +++ b/packages/core/src/api/user.ts @@ -12,8 +12,6 @@ import { type RESTPatchAPICurrentUserResult, type RESTPatchAPIGuildMemberJSONBody, type RESTPatchAPIGuildMemberResult, - type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, - type RESTPatchAPIGuildVoiceStateCurrentMemberResult, type RESTPostAPICurrentUserCreateDMChannelResult, type RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, type RESTPutAPICurrentUserApplicationRoleConnectionResult, @@ -99,19 +97,6 @@ export class UsersAPI { }) as Promise; } - /** - * Sets the voice state for the current user - * - * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state} - * @param guildId - The id of the guild - * @param options - The options to use when setting the voice state - */ - public async setVoiceState(guildId: Snowflake, options: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = {}) { - return this.rest.patch(Routes.guildVoiceState(guildId, '@me'), { - body: options, - }) as Promise; - } - /** * Opens a new DM channel with a user *