Feature/81 slash command support (#192)

* Update discord.js

* Migrate to slash commands

* Clean up imports

* Update permissions

* Fix guild-specific commands not showing up

* Fix changes requested
This commit is contained in:
Vylpes 2022-09-18 11:57:22 +01:00 committed by GitHub
parent 0465697b87
commit ed8f5927c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 1469 additions and 1850 deletions

View file

@ -1,7 +1,6 @@
import { Client } from "discord.js";
import * as dotenv from "dotenv";
import { createConnection } from "typeorm";
import DefaultValues from "../constants/DefaultValues";
import ICommandItem from "../contracts/ICommandItem";
import IEventItem from "../contracts/IEventItem";
import { Command } from "../type/command";
@ -47,14 +46,13 @@ export class CoreClient extends Client {
return;
});
super.on("messageCreate", (message) => {
this._events.onMessageCreate(message, CoreClient._commandItems)
});
super.on("interactionCreate", this._events.onInteractionCreate);
super.on("ready", this._events.onReady);
super.login(process.env.BOT_TOKEN);
await super.login(process.env.BOT_TOKEN);
this._util.loadEvents(this, CoreClient._eventItems);
this._util.loadSlashCommands(this);
}
public static RegisterCommand(name: string, command: Command, serverId?: string) {