Shasha/cmds/utility/say.js
Neko Life 40599b7071 small fix:
enable edit command message to edit response
2021-05-30 13:47:44 +00:00

32 lines
No EOL
1,012 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const commando = require("@iceprod/discord.js-commando");
const emoteMessage = require("../../resources/emoteMessage");
const { ranLog, trySend, tryDelete } = require("../../resources/functions");
module.exports = class say extends commando.Command {
constructor(client) {
super(client, {
name: "say",
memberName: "say",
group: "utility",
description: "Say."
});
}
run(msg, args) {
let noArgs = '';
if (!args) {
args = noArgs;
}
args = emoteMessage(this.client, args);
const sendThis = {content:args, disableMentions:"all"};
if (msg.member?.hasPermission('MENTION_EVERYONE')) {
sendThis.disableMentions = "none";
}
const sent = trySend(this.client, msg, sendThis);
if (args !== noArgs && msg.channel.guild && msg.member.hasPermission("MANAGE_MESSAGES")) {
tryDelete(msg);
}
return sent;
}
};