-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathaddDefaultUserOption.ts
More file actions
36 lines (34 loc) · 1022 Bytes
/
addDefaultUserOption.ts
File metadata and controls
36 lines (34 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright © 2026 BotForge
*/
import { MentionableSelectMenuBuilder, UserSelectMenuBuilder } from "discord.js"
import { ArgType, NativeFunction } from "../../structures"
import { getLastComponent } from "../../functions/components"
export default new NativeFunction({
name: "$addDefaultUserOption",
version: "1.4.0",
aliases: [
"$addDefaultUsers",
"$addDefaultUserOptions"
],
description: "Adds default user options to the last select menu",
unwrap: true,
brackets: true,
args: [
{
name: "user IDs",
description: "The user ids",
rest: true,
required: true,
type: ArgType.String
}
],
execute(ctx, [ ids ]) {
const menu = getLastComponent(ctx)
if (menu instanceof UserSelectMenuBuilder || menu instanceof MentionableSelectMenuBuilder) {
menu.addDefaultUsers(ids)
}
return this.success()
},
})