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

24 lines
No EOL
919 B
JavaScript

'use strict';
const commando = require("@iceprod/discord.js-commando");
const { getChannelMessage, ranLog, errLog, noPerm, trySend } = require("../../resources/functions");
module.exports = class mesemb extends commando.Command {
constructor(client) {
super(client, {
name: "mesemb",
memberName: "mesemb",
group: "utility",
description: "Fetch embed info in a message."
});
}
async run(msg, arg) {
const args = arg.trim().split(/ +/);
const message = await getChannelMessage(this.client,msg,args[0],args[1]);
if (!message) {
return trySend(this.client, msg, "404 message not found!");
}
const mesemb = '```js\n'+JSON.stringify(message.embeds, null, 2)+'```';
return trySend(this.client, msg, {content:'Collected:'+mesemb,split:{maxLength:2000,char: ",",append:',```',prepend:'```js\n'}});
}
};