@@ -6,37 +6,37 @@ import 'dotenv/config'
66import { container } from 'tsyringe'
77
88export const client = new Client ( {
9- simpleCommand : {
10- prefix : "!" ,
11- } ,
12- intents : [
13- IntentsBitField . Flags . Guilds ,
14- IntentsBitField . Flags . GuildMembers ,
15- IntentsBitField . Flags . GuildMessages ,
16- IntentsBitField . Flags . GuildMessageReactions ,
17- IntentsBitField . Flags . GuildVoiceStates ,
18- ] ,
19- // If you only want to use global commands only, comment this line
20- botGuilds : [ ( client ) => client . guilds . cache . map ( ( guild ) => guild . id ) ] ,
9+ simpleCommand : {
10+ prefix : "!" ,
11+ } ,
12+ intents : [
13+ IntentsBitField . Flags . Guilds ,
14+ IntentsBitField . Flags . GuildMembers ,
15+ IntentsBitField . Flags . GuildMessages ,
16+ IntentsBitField . Flags . GuildMessageReactions ,
17+ IntentsBitField . Flags . GuildVoiceStates ,
18+ ] ,
19+ // If you only want to use global commands only, comment this line
20+ botGuilds : [ ( client ) => client . guilds . cache . map ( ( guild ) => guild . id ) ] ,
2121} ) ;
2222
2323
2424client . once ( "clientReady" , async ( ) => {
25- // make sure all guilds are in cache
26- await client . guilds . fetch ( ) ;
25+ // make sure all guilds are in cache
26+ await client . guilds . fetch ( ) ;
2727
28- // init all application commands
29- await client . initApplicationCommands ( ) ;
28+ // init all application commands
29+ await client . initApplicationCommands ( ) ;
3030
3131 // init permissions; enabled log to see changes
32- // await client.initApplicationPermissions(true);
32+ // await client.initApplicationPermissions(true);
3333
3434 // uncomment this line to clear all guild commands,
3535 // useful when moving to global commands from guild commands
3636 // await client.clearApplicationCommands(
3737 // ...client.guilds.cache.map((g) => g.id)
3838 // );
39-
39+
4040 console . log ( "Bot started" ) ;
4141} ) ;
4242
@@ -49,21 +49,21 @@ client.on("messageCreate", (message: Message) => {
4949} ) ;
5050
5151async function run ( ) {
52-
52+
5353 DIService . engine = tsyringeDependencyRegistryEngine . setInjector ( container )
54- // with cjs
55- // await importx(dirname + "/{events,commands}/**/*.{ts,js}");
56- // with ems
57- await importx (
58- dirname ( import . meta. url ) + "/{events,commands,services,utils}/**/*.{ts,js}"
54+ // with cjs
55+ // await importx(dirname + "/{events,commands}/**/*.{ts,js}");
56+ // with ems
57+ await importx (
58+ dirname ( import . meta. url ) + "/{events,commands,services,utils}/**/*.{ts,js}"
5959 ) ;
6060
6161 // let's start the bot
6262 if ( ! process . env . BOT_TOKEN ) {
6363 throw Error ( "Could not find BOT_TOKEN in your environment" ) ;
6464 }
6565 await client . login ( process . env . BOT_TOKEN ) ; // provide your bot token
66-
66+
6767}
6868
6969run ( ) ;
0 commit comments