fixed list prop

This commit is contained in:
mmacierzanka committed 2021-09-02 22:52:51 +02:00
1 parent 23f7279635
commit c92cdf875c
2 files changed
+3 -7

No files matched your search

+2 -6
View File
@@ -250,15 +250,11 @@ export class Bot extends EventEmitter {
process.stdout.write("Registering commands... ");
await axios.put(
`https://discord.com/api/v8/applications/${this.applicationId}/commands`,
this.commands
.getList()
.filter((c) => !Array.isArray(c.guilds) && c.slash)
.map((c) => c.toCommandObject()),
this.commands.list.filter((c) => !Array.isArray(c.guilds) && c.slash).map((c) => c.toCommandObject()),
{ headers: { Authorization: `Bot ${this.token}` } }
);
const guilds: any = {};
await this.commands
.getList()
await this.commands.list
.filter((c) => Array.isArray(c.guilds) && c.guilds.length > 0)
.map((c) => {
c.guilds?.map(async (g) => {
+1 -1
View File
@@ -61,7 +61,7 @@ export class HelpMessage extends Command {
helpMsg.setTitle(params.title);
helpMsg.setDescription(params.bottomText);
cmdManager.getList().map((c) => {
cmdManager.list.map((c) => {
if (
c.visible &&
((Array.isArray(c.guilds) && c.guilds.length > 0 && c.guilds.find((g) => i?.guild?.id === g)) || !Array.isArray(c.guilds) || c.guilds.length === 0)