Fix error handler
Took 8 minutes
This commit is contained in:
parent
5e8f1b27e6
commit
18656427b5
7
index.js
7
index.js
@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user