refactor!: move dirs outside of src/ (#2032)

This commit is contained in:
Skillz4Killz
2022-02-11 04:49:53 -05:00
committed by GitHub
parent 471ef5cb6c
commit 8aaea9f339
594 changed files with 84 additions and 66 deletions
+22
View File
@@ -0,0 +1,22 @@
import type { UpdateVoiceState } from "../../types/voice/updateVoiceState.ts";
import type { AtLeastOne } from "../../types/util.ts";
import type { Bot } from "../../bot.ts";
import { GatewayOpcodes } from "../../types/codes/gatewayOpcodes.ts";
/** Connect or join a voice channel inside a guild. By default, the "selfDeaf" option is true. Requires `CONNECT` and `VIEW_CHANNEL` permissions. */
export async function connectToVoiceChannel(
bot: Bot,
guildId: bigint,
channelId: bigint,
options?: AtLeastOne<Omit<UpdateVoiceState, "guildId" | "channelId">>,
) {
bot.gateway.sendShardMessage(bot.gateway, bot.utils.calculateShardId(bot.gateway, guildId), {
op: GatewayOpcodes.VoiceStateUpdate,
d: {
guild_id: guildId.toString(),
channel_id: channelId.toString(),
self_mute: Boolean(options?.selfMute),
self_deaf: options?.selfDeaf ?? true,
},
});
}