mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-05-25 18:04:01 +00:00
Add name to CommandTable
This commit is contained in:
@@ -51,7 +51,7 @@ export class CommandTable<ExecutorType extends BaseFunction = BaseFunction> {
|
||||
/** Imported tables are tables that "add commands" to this table. They are not sub commands. */
|
||||
private readonly importedTables = new Set<CommandTable>();
|
||||
|
||||
constructor() {
|
||||
constructor(public readonly name: string|symbol) {
|
||||
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export function defineCommandTable(name: string|symbol): CommandTable {
|
||||
if (COMMAND_TABLE_TABLE.has(name)) {
|
||||
throw new TypeError(`A table called ${name.toString()} already exists`);
|
||||
}
|
||||
const table = new CommandTable();
|
||||
const table = new CommandTable(name);
|
||||
COMMAND_TABLE_TABLE.set(name, table);
|
||||
return table;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user