File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 8
8
SlashCommandUserOption ,
9
9
type TextChannel ,
10
10
type User ,
11
+ userMention ,
11
12
} from "discord.js" ;
12
13
13
14
import type { ApplicationCommand } from "@/commands/command.js" ;
@@ -18,7 +19,7 @@ import type { ReactionHandler } from "@/handler/ReactionHandler.js";
18
19
import * as ehreService from "@/service/ehre.js" ;
19
20
20
21
function createUserPointString ( e : EhrePoints ) {
21
- return `<@ ${ e . userId } > : ${ ehreService . formatPoints ( e . points ) } ` ;
22
+ return `${ userMention ( e . userId ) } : ${ ehreService . formatPoints ( e . points ) } ` ;
22
23
}
23
24
24
25
async function createEhreTable (
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
RoleSelectMenuBuilder ,
12
12
type RoleSelectMenuInteraction ,
13
13
type Snowflake ,
14
+ userMention ,
14
15
} from "discord.js" ;
15
16
16
17
import type { BotContext } from "@/context.js" ;
@@ -153,7 +154,7 @@ export default class FaulenzerPingCommand implements ApplicationCommand {
153
154
) {
154
155
const userChunks = chunkArray ( usersToNotify , 10 ) ;
155
156
for ( const users of userChunks ) {
156
- const usersToNotifyMentions = users . map ( userId => `<@ ${ userId } >` ) . join ( " " ) ;
157
+ const usersToNotifyMentions = users . map ( userMention ) . join ( " " ) ;
157
158
158
159
await originalMessage . reply ( {
159
160
content : `${ message } ${ usersToNotifyMentions } ` ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
time ,
13
13
TimestampStyles ,
14
14
type GuildTextBasedChannel ,
15
+ userMention ,
15
16
} from "discord.js" ;
16
17
17
18
import type { ReactionHandler } from "@/handler/ReactionHandler.js" ;
@@ -231,11 +232,8 @@ export const woisVoteScheduler = async (context: BotContext): Promise<void> => {
231
232
232
233
const chunks = chunkArray ( interestedUsers , 10 ) ;
233
234
for ( const users of chunks ) {
234
- const mentions = users . map ( userId => `<@${ userId } >` ) ;
235
- // It's okay for readability
236
-
237
235
await woisMessage . reply ( {
238
- content : mentions . join ( " " ) ,
236
+ content : users . map ( userMention ) . join ( " " ) ,
239
237
allowedMentions : {
240
238
users,
241
239
} ,
You can’t perform that action at this time.
0 commit comments