fix: crashing when slash command is used as text command (#349)

* progress on fix

* fix: ids
This commit is contained in:
Jacob Nguyen
2024-01-07 15:26:08 -06:00
committed by GitHub
parent 655bb8d358
commit a359f73fa2
6 changed files with 66 additions and 67 deletions

View File

@@ -44,7 +44,10 @@ export class DefaultModuleManager implements ModuleManager {
const publishable = 0b000000110;
return Promise.all(
Array.from(entries)
.filter(([id]) => !(Number.parseInt(id.at(-1)!) & publishable))
.filter(([id]) => {
const last_entry = id.at(-1);
return last_entry == 'B' || !(publishable & Number.parseInt(last_entry!));
})
.map(([, path]) => Files.importModule<CommandModule>(path)),
);
}