diff --git a/example/index.js b/example/index.js index 924ab8b..ccc1c6e 100644 --- a/example/index.js +++ b/example/index.js @@ -12,10 +12,8 @@ const { const client = new Client({ intents: [ IntentsBitField.Flags.Guilds, - IntentsBitField.Flags.DirectMessages, IntentsBitField.Flags.GuildMessages, - ], - partials: [Partials.Message], + ] }); synchronizeSlashCommands( client, diff --git a/package.json b/package.json index d54fda0..e643e04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hunteroi/discord-verification", - "version": "1.1.0", + "version": "1.1.1", "description": "A framework to integrate a verification system with your Discord guild built with DiscordJS", "main": "lib/index.js", "scripts": { diff --git a/src/VerificationManager.ts b/src/VerificationManager.ts index 4524813..98e816d 100644 --- a/src/VerificationManager.ts +++ b/src/VerificationManager.ts @@ -1,4 +1,4 @@ -import { Client, IntentsBitField, Snowflake, Partials } from 'discord.js'; +import { Client, Snowflake } from 'discord.js'; import EventEmitter from 'events'; import { CodeGeneratorService } from './services'; @@ -24,7 +24,6 @@ export class VerificationManager extends EventEmitter { storingSystem: IStoringSystem, senderAPI: ISenderAPI, options: VerificationOptions = { - useInteraction: true, codeGenerationOptions: { length: 6, }, @@ -48,27 +47,6 @@ export class VerificationManager extends EventEmitter { if (!senderAPI) throw 'SenderAPI is required'; this.validateOptions(options); - const intents = new IntentsBitField(client.options.intents); - if (!intents.has(IntentsBitField.Flags.Guilds)) { - throw 'GUILDS intent is required to use this package!'; - } - - if (options.usePrivateMessages) { - if (!intents.has(IntentsBitField.Flags.DirectMessages)) { - throw 'DIRECT_MESSAGES intent is required to use this package!'; - } - if ( - !this.client.options.partials.includes(Partials.Message) - ) { - throw 'MESSAGE partial is required to use this package with DM!'; - } - } else if ( - !options.useInteraction && - !intents.has(IntentsBitField.Flags.GuildMessages) - ) { - throw 'GUILD_MESSAGES intent is required to use this package!'; - } - this.client = client; this.options = options; this.storingSystem = storingSystem; diff --git a/src/types/VerificationOptions.ts b/src/types/VerificationOptions.ts index b4e99d3..80c79d2 100644 --- a/src/types/VerificationOptions.ts +++ b/src/types/VerificationOptions.ts @@ -1,10 +1,6 @@ import { IUser } from '.'; export interface VerificationOptions { - useInteraction: boolean; - - usePrivateMessages?: boolean; - codeGenerationOptions: { charactersWhitelist?: string; length: number;