check that endpoint is in fact an endpoint
This commit is contained in:
parent
893aed0945
commit
06a97858d9
@ -1,6 +1,7 @@
|
||||
const path = require('node:path');
|
||||
const fs = require('node:fs');
|
||||
|
||||
const {Endpoint: BaseEndpoint} = require('../interfaces')
|
||||
const { Util } = require('../../util');
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
|
||||
@ -50,6 +51,7 @@ class Registry {
|
||||
continue;
|
||||
}
|
||||
const endpoint = new Endpoint(server);
|
||||
if(!(endpoint instanceof BaseEndpoint)) throw new Error(`Attempt to load invalid endpoint at ${file.name}`)
|
||||
endpoint.init();
|
||||
|
||||
if (endpoints.has(endpoint.resolveable)) throw new Error(`Error registering endpoint ${endpoint.resolveable}: an endpoint with that resolveable already exists`);
|
||||
|
Loading…
Reference in New Issue
Block a user