File tree Expand file tree Collapse file tree 4 files changed +17
-30
lines changed
Expand file tree Collapse file tree 4 files changed +17
-30
lines changed Original file line number Diff line number Diff line change 1- import type { CommandInteractionOption } from 'discord.js'
2- import { defineCommand , defineArgument , useArguments } from '../../../src'
1+ import { defineCommand , defineArgument } from '../../../src'
32
43export default defineCommand (
54 {
@@ -10,14 +9,17 @@ export default defineCommand(
109 type : 'User' ,
1110 name : 'user' ,
1211 description : 'The user to ban'
12+ } ) ,
13+ defineArgument ( {
14+ type : 'String' ,
15+ name : 'reason' ,
16+ description : 'The reason for the ban'
1317 } )
1418 ]
1519 } ,
1620 ( _ , interaction , options ) => {
17- const { get } = useArguments ( options )
21+ const { user , reason } = options . args
1822
19- interaction . reply (
20- `Banned user ${ get < CommandInteractionOption > ( 'user' ) . user ?. username } `
21- )
23+ interaction . reply ( `Banned user ${ user } for ${ reason } ` )
2224 }
2325)
Original file line number Diff line number Diff line change 11import { defineArgument , defineCommand } from '../../../src'
2- import { CommandArgType } from '../../../src/types'
32
43export default defineCommand (
54 {
@@ -17,7 +16,9 @@ export default defineCommand(
1716 } )
1817 ]
1918 } ,
20- ( _ , message ) => {
21- message . reply ( 'Kicked user' )
19+ ( _ , interaction , options ) => {
20+ const { user, reason } = options . args
21+
22+ interaction . reply ( `Kicked user ${ user } for ${ reason } ` )
2223 }
2324)
Original file line number Diff line number Diff line change 1- import { defineArgument , defineCommand , useArguments } from '../../../src'
1+ import { defineCommand } from '../../../src'
22
33export default defineCommand (
44 {
55 slash : false ,
6- description : 'Pong!' ,
7- args : [
8- defineArgument ( {
9- type : 'String' ,
10- name : 'message' ,
11- description : 'The message to send'
12- } ) ,
13- defineArgument ( {
14- type : 'String' ,
15- name : 'user' ,
16- description : 'The user to ping'
17- } )
18- ]
6+ description : 'Pong!'
197 } ,
20- ( client , message , options ) => {
21- const { get } = useArguments ( options )
22-
23- message . reply ( `Pong ${ client . ws . ping } ms! ${ get < string > ( 'user' ) } ` )
8+ ( client , message ) => {
9+ message . reply ( `Pong ${ client . ws . ping } ms!` )
2410 }
2511)
Original file line number Diff line number Diff line change @@ -4,7 +4,5 @@ export default defineCommand(
44 {
55 description : 'Test the bot'
66 } ,
7- ( ) => {
8- console . log ( 'Tested the bot' )
9- }
7+ ( ) => console . log ( 'Tested the bot' )
108)
You can’t perform that action at this time.
0 commit comments