Fix error handler

Took 8 minutes
This commit is contained in:
Tobias Hopp 2021-03-15 11:13:32 +01:00
parent 5e8f1b27e6
commit 18656427b5

View File

@ -104,7 +104,7 @@ client.on ( "message", async ( message ) =>
await message.delete (); await message.delete ();
let notifyChannelID = await getNotifyChannel ( message.guild.id ); 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 // NotifyChannel not send, so we gonna send the msg here
const notify = new Discord.MessageEmbed () 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 <Wort/Satz>` ); await message.reply ( `bitte gebe ein Wort/Satz mit an. ${ config.prefix }add <Wort/Satz>` );
} }
break; break;
case "setnotify":
case "setnotifychannel": case "setnotifychannel":
case "setnotify": case "setnotify":
case "setchannel": case "setchannel":
@ -366,6 +365,10 @@ async function getNotifyChannel( a_ServerID )
return await getNotifyChannel( a_ServerID ); return await getNotifyChannel( a_ServerID );
} }
if( results[0]['notify_channel'] === null )
{
return null;
}
return await results[0]['notify_channel'].toString(); return await results[0]['notify_channel'].toString();
} }