kvalitní patch na nekvalitní chybu

This commit is contained in:
Histmy 2023-08-24 20:08:51 +02:00
parent 8fcc63d753
commit be228e0048
5 changed files with 10 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "denim_3001",
"version": "3001.53.0",
"version": "3001.53.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "denim_3001",
"version": "3001.53.0",
"version": "3001.53.1",
"license": "ISC",
"dependencies": {
"@discordjs/voice": "^0.16.0",

View File

@ -1,6 +1,6 @@
{
"name": "denim_3001",
"version": "3001.53.0",
"version": "3001.53.1",
"description": "Toto je velmi kvalitní bot.",
"repository": {
"url": "https://github.com/Histmy/Denim-Bot/"

View File

@ -1,7 +1,7 @@
import { APIEmbed, CommandInteractionOption, Message, TextBasedChannel } from "discord.js";
import { CClient, Modul } from "../utils/types";
import { createPool } from "mysql";
import { strankovani } from "../utils/utils";
import { log, strankovani } from "../utils/utils";
// Připojení do databáze
const pool = createPool({
@ -147,6 +147,7 @@ const exp: Modul = {
try {
await zpracovatZpravu(mes);
} catch {
log("general sync kompletni");
return;
}
}

View File

@ -3,6 +3,7 @@ import { Message } from "discord.js";
import { emouty } from "../utils/emotes";
import { Modul } from "../utils/types";
import { prefix } from "../utils/utils";
import { novejLeave } from "../utils/voice";
let spim = false;
@ -21,7 +22,7 @@ const exp: Modul = {
} else if (!spim) {
if (cont == `${prefix} vypni se`) {
mes.react(emouty.purfieRIP);
getVoiceConnections().forEach(con => con.destroy());
getVoiceConnections().forEach(con => novejLeave(con.joinConfig.guildId));
mes.client.user?.setStatus("invisible");
spim = true;
}

View File

@ -113,7 +113,9 @@ export function novejLeave(guildId: string) {
clearTimeout(timeouty.get(guildId));
timeouty.delete(guildId);
if (vojs.conn.state.status != VoiceConnectionStatus.Destroyed)
vojs.conn.destroy();
vojsy.delete(guildId);
return true;