Revert "Fixed errors and upgraded to discordjs 13"

This reverts commit 296460a062.
This commit is contained in:
mmacierzanka committed 2021-08-06 21:43:58 +02:00
1 parent 296460a062
commit 6e966b243b
6 files changed
+56 -122

No files matched your search

+5 -15
View File
@@ -1,11 +1,5 @@
//IMPORTS
import {
Client,
ClientOptions,
Intents,
Message,
TextChannel,
} from "discord.js";
import { Client, ClientOptions, Message } from "discord.js";
import { Command, CommandManager, CommandMessageStructure } from "./Command.js";
import { PermissionsError } from "./Error.js";
import { HelpMessage, HelpMessageParams } from "./Help.js";
@@ -55,11 +49,7 @@ export class Bot extends EventEmitter {
constructor(options: ConstructorOptions) {
super();
this.name = options.name;
this.client = new Client(
options.clientOptions || {
intents: Intents.FLAGS.GUILDS,
}
);
this.client = new Client(options.clientOptions);
this.commands = new CommandManager(
options.prefix,
options.argumentSeparator
@@ -129,7 +119,7 @@ export class Bot extends EventEmitter {
user: m.member || undefined,
command: cmdMsg.command,
},
m.channel as TextChannel
m.channel
);
} else {
this.messages.system.send(
@@ -139,7 +129,7 @@ export class Bot extends EventEmitter {
user: m.member || undefined,
error: e,
},
m.channel as TextChannel
m.channel
);
console.error(e);
}
@@ -151,7 +141,7 @@ export class Bot extends EventEmitter {
this.messages.system.send(
"NOT_FOUND",
{ phrase: m.content, user: m.member || undefined },
m.channel as TextChannel
m.channel
);
} else {
this.emit("MESSAGE", m);