Commit 0ae32dcb authored by George Peter Banyard's avatar George Peter Banyard

Implemented a no message send option.

To trigger it null must be returned in the reply function.
parent c32d1794
......@@ -357,13 +357,15 @@ DiscordBotClient.on('message', async message =>
};
let replyData = await reply();
if (replyData.noDelete !== true) {
message.delete();
}
if (replyData.hasOwnProperty(channel) === true) {
replyData.channel.send(replyData.message).catch(e => console.error(e));
} else {
channel.send(replyData.message).catch(e => console.error(e));
if (replyData !== null) {
if (replyData.noDelete !== true) {
message.delete();
}
if (replyData.hasOwnProperty(channel) === true) {
replyData.channel.send(replyData.message).catch(e => console.error(e));
} else {
channel.send(replyData.message).catch(e => console.error(e));
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment