fix command permission handling and push discord to v10 (#640)

Co-authored-by: Max Isom <hi@maxisom.me>
This commit is contained in:
Kevin Kendzia 2022-05-14 02:44:14 +02:00 committed by GitHub
parent 1ef05aba9d
commit eb2885b206
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1214 additions and 644 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, Intents} from 'discord.js';
import {Client, GatewayIntentBits} from 'discord.js';
import ConfigProvider from './services/config.js';
// Managers
@ -41,12 +41,10 @@ import KeyValueCacheProvider from './services/key-value-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.DIRECT_MESSAGES); // To receive the prefix message
intents.add(Intents.FLAGS.GUILD_VOICE_STATES); // To listen for voice state changes (voiceStateUpdate event)
const intents: GatewayIntentBits[] = [];
intents.push(GatewayIntentBits.Guilds); // To listen for guildCreate event
intents.push(GatewayIntentBits.GuildMessageReactions); // To listen for message reactions (messageReactionAdd event)
intents.push(GatewayIntentBits.GuildVoiceStates); // To listen for voice state changes (voiceStateUpdate event)
// Bot
container.bind<Bot>(TYPES.Bot).to(Bot).inSingletonScope();