move command init to constructor

This commit is contained in:
mightypanders 2021-11-11 00:58:46 +01:00
parent 39e4ca69f1
commit 9e923f1657
3 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,5 @@
import express, { Application } from "express"
import { config } from "./server/configuration"
import { commandList } from "./server/constants"
import DiscordAdapter from "./server/discordAdapter"
import Routes from "./server/routes"
import Server from "./server/server"
@ -11,5 +10,4 @@ server.start(() => {
console.log(`Server running on port ${server.getPort()}`)
new Routes().setRoutes(server.getApp())
const discordAdapter = new DiscordAdapter()
discordAdapter.registerCommands(commandList)
})

View File

@ -20,6 +20,7 @@
"cors": "^2.8.5",
"discord-api-types": "^0.24.0",
"discord.js": "^13.3.1",
"dotenv": "^10.0.0",
"eslint": "^8.2.0",
"express": "^4.17.1",
"jest": "^27.3.1",

View File

@ -1606,6 +1606,11 @@ dot-prop@^6.0.1:
dependencies:
is-obj "^2.0.0"
dotenv@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"