mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
rem
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type {
|
||||
UpdateSelfVoiceState,
|
||||
} from "../../types/guilds/update_self_voice_state.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { snakelize } from "../../util/utils.ts";
|
||||
|
||||
/**
|
||||
* Updates the current user's voice state.
|
||||
* Caveats:
|
||||
* - `channel_id` must currently point to a stage channel.
|
||||
* - current user must already have joined `channel_id`.
|
||||
* - You must have the `MUTE_MEMBERS` permission to unsuppress yourself. You can always suppress yourself.
|
||||
* - You must have the `REQUEST_TO_SPEAK` permission to request to speak. You can always clear your own request to speak.
|
||||
* - You are able to set `request_to_speak_timestamp` to any present or future time.
|
||||
*/
|
||||
export async function updateBotVoiceState(
|
||||
guildId: bigint,
|
||||
data: UpdateSelfVoiceState,
|
||||
) {
|
||||
return await rest.runMethod(
|
||||
"patch",
|
||||
endpoints.UPDATE_VOICE_STATE(guildId),
|
||||
snakelize(data),
|
||||
);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type {
|
||||
UpdateOthersVoiceState,
|
||||
} from "../../types/guilds/update_others_voice_state.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { snakelize } from "../../util/utils.ts";
|
||||
|
||||
/**
|
||||
* Updates another user's voice state.
|
||||
* Caveats:
|
||||
* - `channel_id` must currently point to a stage channel.
|
||||
* - User must already have joined `channel_id`.
|
||||
* - You must have the `MUTE_MEMBERS` permission. (Since suppression is the only thing that is available currently.)
|
||||
* - When unsuppressed, non-bot users will have their `request_to_speak_timestamp` set to the current time. Bot users will not.
|
||||
* - When suppressed, the user will have their `request_to_speak_timestamp` removed.
|
||||
*/
|
||||
export function updateVoiceState(
|
||||
guildId: bigint,
|
||||
userId: bigint,
|
||||
data: UpdateOthersVoiceState,
|
||||
) {
|
||||
return rest.runMethod(
|
||||
"patch",
|
||||
endpoints.UPDATE_VOICE_STATE(guildId, userId),
|
||||
snakelize(data),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user