feat: discord.js v13

This commit is contained in:
Hellyson Rodrigo Parteka 2021-11-12 16:30:18 -03:00 committed by Max Isom
parent 1ddd19dbb9
commit fe5f9cf9a7
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
13 changed files with 381 additions and 158 deletions

View file

@ -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();