-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (34 loc) · 1.06 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const Discord = require('discord.js');
const MatchModel = require('./models/matchModel');
const MatchView = require('./views/matchView');
const MatchController = require('./controllers/matchController');
// Créer un client Discord avec les intents voulus
const {
Client,
GatewayIntentBits,
Partials,
EmbedBuilder
} = Discord;
const client = new Client({
intents:[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.MessageContent,
],
partials: [
Partials.Channel,
Partials.Message,
Partials.Reaction,
]
});
const matchModel = new MatchModel();
const matchView = new MatchView();
const matchController = new MatchController(matchModel, matchView);
client.on('messageCreate', (message) => matchController.handleCommand(message));
client.on('messageReactionAdd', (reaction, user) => matchController.handleReaction(reaction, user));
client.once('ready', () => {
console.log('Bot prêt');
// Autres initialisations si nécessaires
});
client.login(process.env.TOKEN);