mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-11 12:21:37 +02:00
feat: discord.js v13
This commit is contained in:
parent
1ddd19dbb9
commit
fe5f9cf9a7
13 changed files with 381 additions and 158 deletions
|
@ -2,7 +2,7 @@ import 'reflect-metadata';
|
|||
import {Container} from 'inversify';
|
||||
import {TYPES} from './types.js';
|
||||
import Bot from './bot.js';
|
||||
import {Client} from 'discord.js';
|
||||
import {Client, Intents} from 'discord.js';
|
||||
import ConfigProvider from './services/config.js';
|
||||
|
||||
// Managers
|
||||
|
@ -32,9 +32,16 @@ import CacheProvider from './services/cache.js';
|
|||
|
||||
const container = new Container();
|
||||
|
||||
// Intents
|
||||
const intents = new Intents();
|
||||
intents.add(Intents.FLAGS.GUILDS); // To listen for guildCreate event
|
||||
intents.add(Intents.FLAGS.GUILD_MESSAGES); // To listen for messages (messageCreate event)
|
||||
intents.add(Intents.FLAGS.DIRECT_MESSAGE_REACTIONS); // To listen for message reactions (messageReactionAdd event)
|
||||
intents.add(Intents.FLAGS.GUILD_VOICE_STATES); // To listen for voice state changes (voiceStateUpdate event)
|
||||
|
||||
// Bot
|
||||
container.bind<Bot>(TYPES.Bot).to(Bot).inSingletonScope();
|
||||
container.bind<Client>(TYPES.Client).toConstantValue(new Client());
|
||||
container.bind<Client>(TYPES.Client).toConstantValue(new Client({intents}));
|
||||
|
||||
// Managers
|
||||
container.bind<PlayerManager>(TYPES.Managers.Player).to(PlayerManager).inSingletonScope();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue