-
Notifications
You must be signed in to change notification settings - Fork 2
/
ask.ts
36 lines (32 loc) · 873 Bytes
/
ask.ts
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
import * as app from "#app"
export default new app.SlashCommand({
name: "ask",
description: "Ask points to a member",
channelType: "thread",
guildOnly: true,
async run(interaction) {
if (interaction.base.user.id === interaction.channel.ownerId)
return interaction.base.reply({
content: `${app.emote(
interaction,
"Cross",
)} You can't ask points to yourself.`,
ephemeral: true,
})
const target = (await interaction.channel.fetchOwner({
force: true,
cache: false,
}))!
await interaction.base.reply(
await app.buildAskPointEmbed(
interaction.base.user,
target,
interaction.guild,
),
)
await app.sendLog(
interaction.guild,
`${interaction.base.user} ask points to ${target.user} in ${interaction.channel}.`,
)
},
})