Skip to content

Commit ec6bd08

Browse files
committed
Fixed Typescript errors
1 parent 7ed411a commit ec6bd08

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/index.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
import Discord from 'discord.js';
1+
import { Client, GatewayIntentBits, Collection } from 'discord.js';
22
import config from './data/config.js';
33

44
import loadEvents from './handlers/events.js';
55
import loadInteractions from './handlers/handler.js';
66
import registerApplicationCommands from './handlers/application.js';
77
import { loadCronJobs } from './handlers/cronjobs.js';
88

9-
const client = new Discord.Client({
9+
declare module 'discord.js' {
10+
interface Client {
11+
interaction: Collection<string, object>; // Passende Typen hier einsetzen
12+
}
13+
}
14+
15+
const client = new Client({
1016
intents: [
11-
Discord.GatewayIntentBits.MessageContent,
12-
Discord.GatewayIntentBits.Guilds,
13-
Discord.GatewayIntentBits.GuildMessages,
14-
Discord.GatewayIntentBits.GuildMembers,
15-
Discord.GatewayIntentBits.GuildIntegrations,
16-
Discord.GatewayIntentBits.GuildPresences,
17-
Discord.GatewayIntentBits.GuildMessageTyping,
18-
Discord.GatewayIntentBits.DirectMessages,
17+
GatewayIntentBits.MessageContent,
18+
GatewayIntentBits.Guilds,
19+
GatewayIntentBits.GuildMessages,
20+
GatewayIntentBits.GuildMembers,
21+
GatewayIntentBits.GuildIntegrations,
22+
GatewayIntentBits.GuildPresences,
23+
GatewayIntentBits.GuildMessageTyping,
24+
GatewayIntentBits.DirectMessages,
1925
],
2026
allowedMentions: {
2127
repliedUser: false // This will allow the bot to ping the user who used the command
@@ -24,7 +30,7 @@ const client = new Discord.Client({
2430

2531
await client.login(config.bot.token);
2632

27-
client.interaction = new Discord.Collection();
33+
client.interaction = new Collection();
2834

2935
await loadEvents(client);
3036
await loadInteractions('./dist/interactions', client);

0 commit comments

Comments
 (0)