File tree Expand file tree Collapse file tree 5 files changed +53
-16
lines changed
Expand file tree Collapse file tree 5 files changed +53
-16
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ import { createHarmony } from '../dist/index.mjs'
44import 'dotenv/config'
55
66const initHarmony = async ( ) => {
7- const harmony = await createHarmony (
8- { rootDir : './playground' } ,
9- { cwd : './playground' }
10- )
11- console . log ( harmony )
7+ await createHarmony ( { rootDir : './playground' } , { cwd : './playground' } )
128}
139
1410initHarmony ( )
Original file line number Diff line number Diff line change 1- import { defineCommand } from '../../../src'
1+ import type { CommandInteractionOption } from 'discord.js'
2+ import { defineCommand , defineArgument , useArguments } from '../../../src'
23
34export default defineCommand (
45 {
56 slash : true ,
6- description : 'Ban a user from the server'
7+ description : 'Ban a user from the server' ,
8+ args : [
9+ defineArgument ( {
10+ type : 'User' ,
11+ name : 'user' ,
12+ description : 'The user to ban'
13+ } )
14+ ]
715 } ,
8- ( _ , interaction ) => {
9- interaction . reply ( 'Banned user' )
16+ ( _ , interaction , options ) => {
17+ const { get } = useArguments ( options )
18+
19+ interaction . reply (
20+ `Banned user ${ get < CommandInteractionOption > ( 'user' ) . user ?. username } `
21+ )
1022 }
1123)
Original file line number Diff line number Diff line change 1- import { defineCommand } from '../../../src'
1+ import { defineArgument , defineCommand } from '../../../src'
2+ import { CommandArgType } from '../../../src/types'
23
34export default defineCommand (
45 {
5- description : 'Kick a user from the server'
6+ description : 'Kick a user from the server' ,
7+ args : [
8+ defineArgument ( {
9+ type : 'User' ,
10+ name : 'user' ,
11+ description : 'The user to kick'
12+ } ) ,
13+ defineArgument ( {
14+ type : 'String' ,
15+ name : 'reason' ,
16+ description : 'The reason for the kick'
17+ } )
18+ ]
619 } ,
720 ( _ , message ) => {
821 message . reply ( 'Kicked user' )
Original file line number Diff line number Diff line change 1- import { defineCommand } from '../../../src'
1+ import { defineArgument , defineCommand , useArguments } from '../../../src'
22
33export default defineCommand (
44 {
5- description : 'Pong!'
5+ 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+ ]
619 } ,
7- ( client , message ) => {
8- message . reply ( 'Pong ' + client . ws . ping + 'ms!' )
20+ ( client , message , options ) => {
21+ const { get } = useArguments ( options )
22+
23+ message . reply ( `Pong ${ client . ws . ping } ms! ${ get < string > ( 'user' ) } ` )
924 }
1025)
Original file line number Diff line number Diff line change 11import { defineHarmonyConfig } from '../src'
22
33export default defineHarmonyConfig ( {
4- defaultPrefix : 'h!'
4+ defaultPrefix : 'h!' ,
5+ clientId : '929023549656662047'
56} )
You can’t perform that action at this time.
0 commit comments