Skip to content

Commit 2adbed5

Browse files
committed
fix(bots/discord): show reminder creator in /reminders
1 parent 2f7efe3 commit 2adbed5

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

bots/discord/src/commands/utilities/reminders.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EmbedBuilder, MessageFlags } from 'discord.js'
2-
import { eq,or } from 'drizzle-orm'
2+
import { eq, or } from 'drizzle-orm'
33
import Command from '$/classes/Command'
44
import { config, database } from '$/context'
55
import { reminders } from '$/database/schemas'
@@ -42,13 +42,19 @@ export default new Command({
4242
}
4343

4444
const reminderList = userReminders
45-
.map(r => {
46-
const targetStr = r.targetId === r.creatorId ? 'yourself' : `<@${r.targetId}>`
47-
return (
45+
.map(
46+
r =>
4847
`**${r.id}.** ${r.message.substring(0, 50)}${r.message.length > 50 ? '...' : ''}\n` +
49-
`-# For ${targetStr} • <t:${r.remindAt}:R> • Reminded ${r.count}x`
50-
)
51-
})
48+
[
49+
`For ${r.targetId === targetId ? 'yourself' : `<@${r.targetId}>`}`,
50+
r.creatorId !== targetId && `Set by <@${r.creatorId}>`,
51+
`<t:${r.remindAt}:R>`,
52+
`Reminded ${r.count} times`,
53+
]
54+
.filter(Boolean)
55+
.join(' • '),
56+
)
57+
5258
.join('\n\n')
5359

5460
const embed = applyCommonEmbedStyles(

0 commit comments

Comments
 (0)