Skip to content

Commit 8debd58

Browse files
committed
test: playground
1 parent b96afe2 commit 8debd58

File tree

3 files changed

+23
-48
lines changed

3 files changed

+23
-48
lines changed

playground/commands/moderations/ban.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
import { defineCommand, defineArgument } from '../../../src'
1+
import { defineCommand } from '../../../src'
22

33
export default defineCommand(
44
{
55
slash: true,
66
description: 'Ban a user from the server',
7-
args: [
8-
defineArgument({
7+
args: {
8+
user: {
99
type: 'User',
10-
name: 'user',
1110
description: 'The user to ban'
12-
}),
13-
defineArgument({
11+
},
12+
reason: {
1413
type: 'String',
15-
name: 'reason',
1614
description: 'The reason for the ban'
17-
})
18-
],
15+
}
16+
},
1917
userPermissions: ['Administrator']
2018
},
21-
(_, interaction, options) => {
22-
const { user, reason } = options.args
19+
(_, interaction, context) => {
20+
const { user, reason } = context.args
2321

2422
interaction.reply(`Banned user ${user} for ${reason}`)
2523
}

playground/commands/moderations/kick.slash.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
import { defineArgument, defineCommand } from '../../../src'
1+
import { defineCommand } from '../../../src'
22

33
export default defineCommand(
44
{
55
description: 'Kick a user from the server',
6-
args: [
7-
defineArgument({
6+
args: {
7+
user: {
88
type: 'User',
9-
name: 'user',
10-
description: 'The user to kick'
11-
}),
12-
defineArgument({
9+
description: 'The user to ban'
10+
},
11+
reason: {
1312
type: 'String',
14-
name: 'reason',
15-
description: 'The reason for the kick'
16-
})
17-
]
13+
description: 'The reason for the ban'
14+
}
15+
}
1816
},
19-
(_, interaction, options) => {
20-
const { user, reason } = options.args
17+
(_, interaction, context) => {
18+
const { user, reason } = context.args
2119

2220
interaction.reply(`Kicked user ${user} for ${reason}`)
2321
}

playground/commands/utils/noop.ts

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
1-
import { ChannelType } from 'discord.js'
2-
import { defineArgument, defineCommand } from '../../../src'
1+
import { defineCommand } from '../../../src'
32

43
export default defineCommand(
54
{
6-
slash: true,
7-
description: 'NOOP!',
8-
args: [
9-
defineArgument({
10-
name: 'noop',
11-
type: 'Integer',
12-
description: 'NOOP!',
13-
metadata: {
14-
choices: [
15-
{
16-
name: '1',
17-
value: 1
18-
},
19-
{
20-
name: '2',
21-
value: 2
22-
}
23-
]
24-
}
25-
})
26-
],
27-
preconditions: ['nsfw']
5+
slash: false,
6+
description: 'NOOP!'
287
},
298
(_, message) => {
309
message.reply('NOOP')

0 commit comments

Comments
 (0)