Fix missing ready event emit, add yarn commands, fix client path
This commit is contained in:
parent
dd5360adcd
commit
9cc8dfd61e
3
.gitignore
vendored
3
.gitignore
vendored
@ -36,6 +36,9 @@ bower_components
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Ignore whole build directory
|
||||
build
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
# Template Dockerfile, expand as necessary
|
||||
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
# For C/C++ dependencies that need to be built
|
||||
RUN apk update && apk add build-base python3
|
||||
WORKDIR /app
|
||||
COPY package.json package.json
|
||||
COPY ./.yarnrc.yml ./.yarnrc.yml
|
||||
COPY ./.yarn/releases ./.yarn/releases
|
||||
RUN yarn install
|
||||
|
||||
FROM node:lts-alpine
|
||||
WORKDIR /app
|
||||
COPY build build
|
||||
COPY --from=builder /musicbot/node_modules ./node_modules
|
||||
COPY package.json package.json
|
||||
# VOLUME [ "/app/cache" ]
|
||||
CMD ["node", "--enable-source-maps", "build/index.js"]
|
||||
# CMD ["/bin/ash"]
|
@ -8,6 +8,10 @@
|
||||
"license": "MIT",
|
||||
"packageManager": "yarn@4.1.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"start": "yarn build && node --enable-source-maps build/index.js --shards 1 --respawn false"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navy.gif/commandparser": "^1.7.4",
|
||||
"@navy.gif/logger": "^2.5.4",
|
||||
|
@ -61,6 +61,7 @@ class Client extends EventEmitter
|
||||
// this.#logger.info('Logging in');
|
||||
const ready = this.#ready();
|
||||
// await super.login();
|
||||
this.emit('ready'); // the ready waiter expects a ready event from the superclass, in our case that doesn't happen so we emit it ourselves
|
||||
await ready;
|
||||
|
||||
this.#built = true;
|
||||
|
@ -21,7 +21,7 @@ class Controller
|
||||
|
||||
constructor (options: ControllerOptions, version: string)
|
||||
{
|
||||
const clientPath = path.join(options.rootDir, 'client/DiscordClient.js');
|
||||
const clientPath = path.join(options.rootDir, 'client/Client.js');
|
||||
if (!fs.existsSync(clientPath))
|
||||
throw new Error(`Client path does not seem to exist: ${clientPath}`);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user