better voice pt2

This commit is contained in:
Histmy 2023-03-05 21:43:50 +01:00 committed by GitHub
parent e506567064
commit 3da87ed42e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,14 +5,17 @@ import { Client } from "discord.js";
import { search, soundcloud, stream, validate, video_basic_info } from "play-dl"; import { search, soundcloud, stream, validate, video_basic_info } from "play-dl";
import { emouty } from "../utils/emotes"; import { emouty } from "../utils/emotes";
import { Modul, SRecord } from "../utils/types"; import { Modul, SRecord } from "../utils/types";
import { adminLog, configureTimeAnouncment, getCurrentPlayer, joinVoice, play } from "../utils/utils"; import { adminLog, configureTimeAnouncment, getCurrentPlayer, joinVoice, log, play } from "../utils/utils";
const kjus: SRecord<{ name: string; url: string; }[]> = {}; const kjus: SRecord<{ name: string; url: string; }[]> = {};
async function zahrat(conn: VoiceConnection, url: string, seek?: number) { async function zahrat(conn: VoiceConnection, url: string, seek?: number) {
try { try {
const src = await stream(url, { seek }); const src = await stream(url, { seek });
play(conn, { name: src.stream, volume: 1, type: src.type }); play(conn, { name: src.stream, volume: 1, type: src.type })
.catch(e => {
log("chyba v muziki", e);
});
} catch (e) { } catch (e) {
console.log(e); console.log(e);
const client: Client = module.exports.client; const client: Client = module.exports.client;