mirror of
https://github.com/danbulant/Shasha
synced 2026-05-25 04:41:51 +00:00
30 lines
No EOL
1.1 KiB
JavaScript
30 lines
No EOL
1.1 KiB
JavaScript
'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: "fun",
|
||
description: "Say."
|
||
});
|
||
}
|
||
async run(msg, args) {
|
||
if (!args) args = '';
|
||
args = emoteMessage(this.client, args);
|
||
const sendThis = { content: args, disableMentions: "all" };
|
||
if (msg.member?.hasPermission('MENTION_EVERYONE')) {
|
||
sendThis.disableMentions = "none";
|
||
}
|
||
const sent = await trySend(this.client, msg, sendThis);
|
||
if (args != '' && msg.channel.guild && msg.member.hasPermission("MANAGE_MESSAGES") && !(new RegExp("^<@\!?" + msg.client.user.id + ">\s")).test(msg.content)) {
|
||
tryDelete(msg);
|
||
}
|
||
ranLog(msg, sent.content);
|
||
return sent;
|
||
}
|
||
}; |