bot should die even less often

This commit is contained in:
Histmy 2022-11-26 17:20:42 +01:00
parent 88d0954d6b
commit 5a225c3ece
4 changed files with 5 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "denim_3001",
"version": "3001.43.3",
"version": "3001.43.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "denim_3001",
"version": "3001.43.3",
"version": "3001.43.4",
"license": "ISC",
"dependencies": {
"@discordjs/voice": "^0.13.0",

View File

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

View File

@ -40,6 +40,7 @@ const exp: Modul = {
} else {
const msg = mes.channel.send("hledam");
const hledani = await search(txt, { limit: 1 });
if (!hledani[0]) return "nic sem nenašel";
ajtem.url = hledani[0].url;
ajtem.name = hledani[0].title!;
msg.then(m => void m.edit(`zahraju \`${ajtem.name}\``));

View File

@ -84,6 +84,7 @@ export async function joinVoice(channel: VoiceChannel | StageChannel | string, g
return { conn, prev: true };
}
prev = conn.joinConfig.channelId!;
if (!prev) throw new Error(`Ty si fakt dement @histmy, ${typeof prev}`);
}
conn = joinVoiceChannel({