allowed execution of commands within direct message channels, also fixed 2 crashes with attempting to delete messages without permission to do so
This commit is contained in:
parent
03a7851605
commit
cb16a007d3
3 changed files with 6 additions and 3 deletions
|
@ -67,7 +67,9 @@ module.exports = {
|
||||||
);
|
);
|
||||||
ableToSend = false;
|
ableToSend = false;
|
||||||
});
|
});
|
||||||
message.delete();
|
if (message.deletable) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
if (ableToSend) {
|
if (ableToSend) {
|
||||||
fs.appendFileSync(
|
fs.appendFileSync(
|
||||||
"../pepperbot/src/logs/forcesay.log",
|
"../pepperbot/src/logs/forcesay.log",
|
||||||
|
|
|
@ -18,7 +18,9 @@ module.exports = {
|
||||||
|
|
||||||
if (msg !== "") {
|
if (msg !== "") {
|
||||||
message.channel.send(msg);
|
message.channel.send(msg);
|
||||||
message.delete();
|
if (message.deletable) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
fs.appendFileSync(
|
fs.appendFileSync(
|
||||||
"../pepperbot/src/logs/forcesay.log",
|
"../pepperbot/src/logs/forcesay.log",
|
||||||
Date() +
|
Date() +
|
||||||
|
|
|
@ -100,7 +100,6 @@ client.on("messageCreate", async (message) => {
|
||||||
message.content +
|
message.content +
|
||||||
'"\n'
|
'"\n'
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (!message.content.startsWith(prefix)) return;
|
if (!message.content.startsWith(prefix)) return;
|
||||||
const args = message.content.slice(prefix.length).split(/ +/);
|
const args = message.content.slice(prefix.length).split(/ +/);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue