server: beautify command logging embed

This commit is contained in:
liushuyu 2023-10-19 17:06:30 -06:00
parent 1e191894ca
commit 04ef587bc9
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437

View File

@ -212,9 +212,16 @@ client.on('messageCreate', async (message) => {
}
} catch (err) { logger.error(err); }
};
const commandUsageEmbed = new discord.EmbedBuilder()
.setAuthor({ name: message.author.username, iconURL: message.author.displayAvatarURL() })
.setDescription(`Command used in ${message.channel.toString()} [Jump To Message](${message.url})`)
.addFields({ name: 'Command', value: `\`\`\`\n${message.content}\n\`\`\``, inline: false })
.setTimestamp()
.setColor('Blue');
const userInfo = `${message.author?.toString()} (${message.author?.username}) (${message.author})`;
await Promise.all(
[
state.msglogChannel?.send(`${message.author.username} ${message.author.id} [Channel: ${message.channel}] executed command: \`${message.content}\``),
state.msglogChannel?.send({ content: userInfo, embeds: [commandUsageEmbed] }),
message.delete(),
executeModule()
]