File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { createError } from './harmonix'
66import { contextMenuToJSON , isHarmonixCommand , slashToJSON } from './utils'
77
88export const initCient = ( harmonixOptions : Harmonix [ 'options' ] ) => {
9- const client = new Client ( { intents : harmonixOptions . intents } )
9+ const client = new Client ( harmonixOptions . clientOptions )
1010
1111 client . login ( process . env . HARMONIX_CLIENT_TOKEN )
1212
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ import { createError } from './harmonix'
55
66const HarmonixDefaults : HarmonixConfig = {
77 scanDirs : [ ] ,
8- ignore : [ ]
8+ ignore : [ ] ,
9+ commands : [ ] ,
10+ events : [ ] ,
11+ contextMenus : [ ] ,
12+ preconditions : [ ]
913}
1014
1115export const loadOptions = async (
@@ -36,11 +40,16 @@ export const loadOptions = async (
3640 )
3741 options . scanDirs = [ ...new Set ( options . scanDirs ) ]
3842 options . defaultPrefix = options . defaultPrefix || '!'
39- options . intents = options . intents || [
43+
44+ const intents = options . clientOptions ?. intents || [
4045 'Guilds' ,
4146 'GuildMessages' ,
42- 'MessageContent'
47+ 'MessageContent' ,
48+ 'GuildMembers'
4349 ]
4450
51+ options . clientOptions = options . clientOptions || { }
52+ options . clientOptions . intents = intents
53+
4554 return options
4655}
Original file line number Diff line number Diff line change 11import type { C12InputConfig } from 'c12'
2- import type {
3- Client ,
4- BitFieldResolvable ,
5- GatewayIntentsString ,
6- Collection
7- } from 'discord.js'
2+ import type { Client , Collection , ClientOptions } from 'discord.js'
83import type { HarmonixCommand , HarmonixCommandInput } from './commands'
94import type { HarmonixEvent , HarmonixEventInput } from './events'
105import type {
@@ -26,7 +21,7 @@ export interface HarmonixOptions {
2621 contextMenus : HarmonixContextMenuInput [ ]
2722 preconditions : HarmonixPreconditionInput [ ]
2823 defaultPrefix : string
29- intents : BitFieldResolvable < GatewayIntentsString , number >
24+ clientOptions : ClientOptions
3025 clientId : string
3126 ownerId : string [ ]
3227}
You can’t perform that action at this time.
0 commit comments