mirror of
https://github.com/danbulant/Shasha
synced 2026-07-05 19:11:13 +00:00
tidy up and rename
This commit is contained in:
parent
e11b7d0fb6
commit
7cdd34f8c5
1 changed files with 42 additions and 0 deletions
42
cmds/utility/cloneembed.js
Normal file
42
cmds/utility/cloneembed.js
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const commando = require("@iceprod/discord.js-commando");
|
||||||
|
const { MessageEmbed } = require("discord.js");
|
||||||
|
const { getChannelMessage, errLog, ranLog, trySend, tryReact } = require("../../resources/functions");
|
||||||
|
|
||||||
|
module.exports = class cloneembed extends commando.Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: "clone-embed",
|
||||||
|
aliases: ["clone-emb","clon-emb", "clon-embed"],
|
||||||
|
memberName: "clonemb",
|
||||||
|
group: "utility",
|
||||||
|
description: "Clone an Embed."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async run(msg, cargs) {
|
||||||
|
const args = cargs.trim().split(/ +/);
|
||||||
|
try {
|
||||||
|
const theMes = await getChannelMessage(this.client,msg,args[0],args[1]);
|
||||||
|
let content;
|
||||||
|
if (theMes.content) {
|
||||||
|
content = theMes.content;
|
||||||
|
}
|
||||||
|
if (!theMes.embeds || (theMes.embeds).length === 0) {
|
||||||
|
return trySend(this.client, msg, 'ypu don\'t know what an embed is? <:cathmmLife:772716381874946068>');
|
||||||
|
}
|
||||||
|
if (!args[0]) {
|
||||||
|
return trySend(this.client, msg, 'Which message??');
|
||||||
|
}
|
||||||
|
trySend(this.client, msg, {content:content,embed:theMes.embeds[0]});
|
||||||
|
const moreEmb = theMes.embeds.slice(1);
|
||||||
|
for(const emb of moreEmb) {
|
||||||
|
trySend(this.client, msg, new MessageEmbed(emb));
|
||||||
|
}
|
||||||
|
tryReact(msg, "a:yesLife:794788847996370945");
|
||||||
|
return ranLog(msg,'clonemb',`Embed ${theMes.url} (${theMes.id}) in ${theMes.channel.name} (${theMes.channel.id}) of ${theMes.guild.name} cloned.`);
|
||||||
|
} catch (e) {
|
||||||
|
return trySend(this.client, msg, "No embed found. Use `<channel_[mention, ID]> <message_ID>` if it's in another channel.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue