From 18656427b5dd44d1319db1f6f03b6af071f7e588 Mon Sep 17 00:00:00 2001 From: Tobias Hopp Date: Mon, 15 Mar 2021 11:13:32 +0100 Subject: [PATCH] Fix error handler Took 8 minutes --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 15f7cde..3535750 100644 --- a/index.js +++ b/index.js @@ -104,7 +104,7 @@ client.on ( "message", async ( message ) => await message.delete (); let notifyChannelID = await getNotifyChannel ( message.guild.id ); - if ( notifyChannelID.length < 1 || notifyChannelID === "" ) + if ( notifyChannelID.length < 1 || notifyChannelID === "" || notifyChannelID === null ) { // NotifyChannel not send, so we gonna send the msg here const notify = new Discord.MessageEmbed () @@ -228,7 +228,6 @@ client.on ( "message", async ( message ) => await message.reply ( `bitte gebe ein Wort/Satz mit an. ${ config.prefix }add ` ); } break; - case "setnotify": case "setnotifychannel": case "setnotify": case "setchannel": @@ -366,6 +365,10 @@ async function getNotifyChannel( a_ServerID ) return await getNotifyChannel( a_ServerID ); } + if( results[0]['notify_channel'] === null ) + { + return null; + } return await results[0]['notify_channel'].toString(); }