Corrected ranLog

This commit is contained in:
Neko Life 2021-06-01 10:43:18 +00:00
parent b338b6622f
commit 648ab8be67
3 changed files with 6 additions and 5 deletions

View file

@ -49,15 +49,15 @@ module.exports = class newquoteotd extends commando.Command {
.setTitle(name)
.setDescription(description)
.setThumbnail(thumbnail)
.setFooter(quoteOTD.footerText, quoteOTD.footerIcon)
.setFooter(quoteOTD.footerText || "", quoteOTD.footerIcon)
.setColor(color[Math.floor(Math.random()*color.length)]);
const sent = trySend(this.client, quoteOTD.channel, emb);
const sent = await trySend(this.client, quoteOTD.channel, emb);
if (sent) {
ranLog(this.client, msg, "New quote: " + sent.content + "\nBy: " + mes.author.tag + ` (${mes.author.id})`);
tryReact(msg, "a:yesLife:794788847996370945");
}
return sent;
}
ranLog(this.client, msg, "New quote: " + msg.content + "\nBy: " + mes.author.tag + ` (${mes.author.id})`);
return trySend(this.client, msg, 'No message with that ID from this channel. Use `[<channel_[mention, ID]> <message_ID>, message_link]` if it\'s in another channel.');
} catch (e) {
noPerm(msg);

View file

@ -55,9 +55,9 @@ module.exports = class send extends commando.Command {
});
collector.on('remove', async r => await msg.reactions.resolve(r).id.remove(r.id));
if (send) {
ranLog(this.client, msg, send.content.slice(0, 1900) + "\n\nSent to: " + `[${send.channel.name}](${send.url}) <#${send.channel.id}> (${send.channel.id})`);
tryReact(msg, 'yeLife:796401669188354090');
}
ranLog(this.client, msg, send.content);
return send;
} catch (e) {
return errLog(e, msg, this.client);

View file

@ -111,7 +111,8 @@ async function ranLog(client, msg, addition) {
.setDescription(addition)
.setFooter(timestampAt(), msg.guild?.iconURL({"size": 4096, "dynamic": true}))
.addField("Guild", `**${msg.guild?.name}** (${msg.guild?.id})`, true)
.addField("Channel", `**${msg.channel?.name}** (${msg.channel.id})`, true);
.addField("Channel", `**${msg.channel?.name}** (${msg.channel.id})`, true)
.addField("User", `<@!${msg.author.id}>`, true);
trySend(client, channel, {embed: embed});
}