Arcane_ish
DIAdiscord.js - Imagine an app
•Created by Arcane_ish on 6/23/2023 in #djs-questions
Can't read default_member_permissions from SlashCommandBuilder?
I'm building a script that documents slash command attributes for a wiki page. I have a wrapper class that holds command attributes that aren't directly used by the SlashCommandBuilder (eg cooldown, execute function).
Strangely, the
default_member_permissions
is readable inside the class, but not outside the wrapper.
For a more concrete exmaple, here's the wrapper constructor:
In the console.log, this shows default_member_permissions: '1024',
.
However, this differs from when it gets logged outside the wrapper class.
This ends up logging default_member_permissions: undefined,
. This seems especially problematic since my command uploader reads the default member permission in the same way, which would likely mean that attribute is getting stripped before getting uploaded. Am I missing something about how exporting might affect SlashCommandBuilders?
Bonus: any recommendations on converting from a permission bit field back to a human readable list of permissions?9 replies