feat: update scoring system and embed message structure
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { EmbedBuilder, MessageReaction, PartialMessageReaction } from 'discord.js';
|
||||
|
||||
export default function awardEmbed(reaction: MessageReaction | PartialMessageReaction) {
|
||||
export default function awardEmbed(reaction: MessageReaction | PartialMessageReaction, score: number) {
|
||||
function formatTime(time: Date) {
|
||||
const yyyy = time.getFullYear();
|
||||
const mm = time.getMonth().toString().padStart(2, '0');
|
||||
@@ -18,7 +18,7 @@ export default function awardEmbed(reaction: MessageReaction | PartialMessageRea
|
||||
.setDescription(reaction.message.content || null)
|
||||
.setThumbnail(reaction.message.attachments.filter((attachment) => !(!attachment.height && !attachment.width)).first()?.url || null)
|
||||
.addFields({
|
||||
name: `${reaction.emoji.name} x${reaction.count} `,
|
||||
value: `in <#${reaction.message.channelId}> • ${formatTime(reaction.message.createdAt)}\n-# ${reaction.message.id}`,
|
||||
name: `${reaction.message.reactions.cache.map((reaction) => `${reaction.emoji} x${reaction.count},`).join(' ')} / ${score.toFixed(1)}`,
|
||||
value: `${reaction.message.url} • ${formatTime(reaction.message.createdAt)}\n-# ${reaction.message.id}`,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user