11require ( "dotenv" ) . config ( ) ;
22const Client = require ( "./src/client.js" ) ;
33const config = require ( "./config.json" ) ;
4- const { Player } = require ( 'discord-player' ) ;
5- const { index} = require ( "./src/utils/dashboard.js" ) ;
4+ const { Player } = require ( "discord-player" ) ;
65const botlist = config . botlist ;
6+ const discordModals = require ( "discord-modals" ) ;
77global . __basedir = __dirname ;
8+ const WebSocket = require ( "ws" ) ;
89
910const client = new Client ( config , {
10- intents : 8191 ,
11- allowedMentions : { parse : [ 'users' , 'roles' ] , repliedUser : true }
11+ partials : [ "CHANNEL" ] ,
12+ intents : 130815 ,
13+ allowedMentions : { parse : [ "users" , "roles" ] , repliedUser : true } ,
1214} ) ;
1315
16+ discordModals ( client ) ;
17+
1418client . player = new Player ( client ) ;
1519const player = client . player ;
1620
1721// Initialize client
1822function init ( ) {
23+
1924 client . loadCommands ( "./src/commands" ) ;
20- client . loadSlashCommands ( "./src/slash" )
25+ client . loadSlashCommands ( "./src/slash" ) ;
26+ client . loadButtons ( "./src/buttons" ) ;
27+ client . loadSelectMenus ( "./src/selectmenus" ) ;
28+ client . loadContextMenus ( "./src/contextmenus" ) ;
29+ client . loadModals ( "./src/modals" ) ;
2130 client . loadEvents ( "./src/events" , client , player ) ;
2231 client . loadMusicEvents ( "./src/music" , player ) ;
2332 client . loadTopics ( "./data/trivia" ) ;
@@ -27,18 +36,19 @@ function init() {
2736init ( ) ;
2837
2938if ( botlist ) {
30- let { botlist} = require ( "./src/utils/botlist.js" )
31- botlist ( client ) . then ( ( ) => {
32- client . logger . info ( "Botlist updated!" ) ;
33- }
34- ) ;
39+ let { botlist } = require ( "./src/utils/botlist.js" ) ;
40+ botlist ( client ) . then ( ( ) => {
41+ client . logger . info ( "Botlist updated!" ) ;
42+ } ) ;
3543}
3644
37-
38- if ( ! ( client . shard ) ) {
39- const { index } = require ( "./src/utils/dashboard.js" ) ;
40- index ( client ) ;
45+ if ( ! client . shard ) {
46+ const { index } = require ( "./src/utils/dashboard.js" ) ;
47+ index ( client ) . then ( ( ) => {
48+ client . logger . info ( "Dashboard initialized!" ) ;
49+ } ) ;
4150}
4251
52+ global . __Client = client ;
4353
4454process . on ( "unhandledRejection" , ( err ) => client . logger . error ( err ) ) ;
0 commit comments