From 648ab8be67b03740796bbd39980a4e8a03e0a501 Mon Sep 17 00:00:00 2001 From: Neko Life Date: Tue, 1 Jun 2021 10:43:18 +0000 Subject: [PATCH] Corrected ranLog --- cmds/utility/newquoteotd.js | 6 +++--- cmds/utility/send.js | 2 +- resources/functions.js | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmds/utility/newquoteotd.js b/cmds/utility/newquoteotd.js index 6372e33..f233301 100644 --- a/cmds/utility/newquoteotd.js +++ b/cmds/utility/newquoteotd.js @@ -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 `[ , message_link]` if it\'s in another channel.'); } catch (e) { noPerm(msg); diff --git a/cmds/utility/send.js b/cmds/utility/send.js index 40baff1..10694b6 100644 --- a/cmds/utility/send.js +++ b/cmds/utility/send.js @@ -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); diff --git a/resources/functions.js b/resources/functions.js index b1da318..4743001 100644 --- a/resources/functions.js +++ b/resources/functions.js @@ -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}); }