Skip to content

Commit 6590eb2

Browse files
committed
Fix deprecated issues
1 parent bbd7706 commit 6590eb2

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/main.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ import 'dotenv/config'
66
import { container } from 'tsyringe'
77

88
export 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

2424
client.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

5151
async 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

6969
run();

src/utils/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ export const writeFile = (arr: string[] | undefined, filePath: string) => {
66
console.log(`⚠️ No data to write to ${filePath}`)
77
return
88
}
9-
9+
1010
const dir = path.dirname(filePath)
1111
if (!fs.existsSync(dir)) {
1212
fs.mkdirSync(dir, { recursive: true })
1313
}
14-
14+
1515
let cleanArray = arr.map((e: string) => `"${e}"`)
1616
try {
1717
fs.writeFile(filePath, `export const links = [${cleanArray}]\n`, err => {

0 commit comments

Comments
 (0)