File tree Expand file tree Collapse file tree 3 files changed +23
-48
lines changed
Expand file tree Collapse file tree 3 files changed +23
-48
lines changed Original file line number Diff line number Diff line change 1- import { defineCommand , defineArgument } from '../../../src'
1+ import { defineCommand } from '../../../src'
22
33export 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 }
Original file line number Diff line number Diff line change 1- import { defineArgument , defineCommand } from '../../../src'
1+ import { defineCommand } from '../../../src'
22
33export 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 }
Original file line number Diff line number Diff line change 1- import { ChannelType } from 'discord.js'
2- import { defineArgument , defineCommand } from '../../../src'
1+ import { defineCommand } from '../../../src'
32
43export 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' )
You can’t perform that action at this time.
0 commit comments