function joinVoice has defined overloads
This commit is contained in:
parent
d0e9994112
commit
6b99ed9b74
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "denim_3001",
|
||||
"version": "3001.33.1",
|
||||
"version": "3001.34.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "denim_3001",
|
||||
"version": "3001.33.1",
|
||||
"version": "3001.34.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "github:discordjs/opus",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "denim_3001",
|
||||
"version": "3001.33.1",
|
||||
"version": "3001.34.0",
|
||||
"description": "Toto je velmi kvalitní bot.",
|
||||
"repository": {
|
||||
"url": "https://github.com/Histmy/Denim-Bot/"
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { VoiceConnection } from "@discordjs/voice";
|
||||
import { Client, ClientEvents, ClientPresenceStatusData, Message, MessageOptions, User } from "discord.js";
|
||||
|
||||
type OutputRunFunkce = string | MessageOptions | void;
|
||||
@ -71,3 +72,8 @@ export interface MuzikaFace {
|
||||
export type KoamndNaExport = {
|
||||
name: string;
|
||||
} & BaseKomandProps;
|
||||
|
||||
export interface JoinHovna {
|
||||
conn: VoiceConnection;
|
||||
prev: string | boolean;
|
||||
};
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { AudioPlayerStatus, AudioResource, createAudioPlayer, createAudioResource, entersState, getVoiceConnection, joinVoiceChannel, PlayerSubscription, VoiceConnection, VoiceConnectionStatus } from "@discordjs/voice";
|
||||
import { Guild, StageChannel, VoiceChannel } from "discord.js";
|
||||
import { once } from "events";
|
||||
import { MuzikaFace, SRecord } from "./types";
|
||||
import { JoinHovna, MuzikaFace, SRecord } from "./types";
|
||||
import { existsSync } from "fs";
|
||||
import { Readable } from "node:stream";
|
||||
|
||||
@ -63,7 +63,9 @@ export const formatCas = (cas: number) => {
|
||||
return `${h} hodin ${m} mynut a ${s} se kund`;
|
||||
};
|
||||
|
||||
export const joinVoice = async (channel: VoiceChannel | StageChannel | string, guild?: Guild) => {
|
||||
export async function joinVoice(channel: VoiceChannel | StageChannel): Promise<JoinHovna>;
|
||||
export async function joinVoice(channel: string, guild: Guild): Promise<JoinHovna>;
|
||||
export async function joinVoice(channel: VoiceChannel | StageChannel | string, guild?: Guild): Promise<JoinHovna> {
|
||||
const channelId = typeof channel === "string" ? channel : channel.id;
|
||||
const guildId = typeof channel === "string" ? guild!.id : channel.guildId;
|
||||
const guilda = typeof channel === "string" ? guild! : channel.guild;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user