#so you want it to return ManageGuild

1 messages · Page 1 of 1 (latest)

storm edge
#

ye

dreamy kestrel
storm edge
#

discord js does not have a converter ?

dreamy kestrel
#

Like:

const permissionsString {
  PermissionsBitField.Flags.xxx: 'xxx',
  PermissionsBitField.Flags.xxx: 'xxx',
  ...
}
dreamy kestrel
storm edge
#

bruhh

dreamy kestrel
#

cause there's not really much of a use for it

#

what are you trying to do with the string?

#

cause I'm not sure there is any use case for this...

storm edge
#

so i put the required permission bitfild in my command when user execute and user dont have it i need to to tell them they need that bitfild permission

vestal vector
#

you could do new PermissionsBitField(PermissionFlagBits.ManageGuild).toArray() which will return 'ManageGuild' as the string permission

dreamy kestrel
#

man I'm dumb

storm edge
vestal vector
storm edge
#

ye thx

vestal vector
#

since PermissionFlagsBits.ManageGuild returns 32n, toArray() returns the actual name of the bit

dreamy kestrel
vestal vector
#

uh no, not in this case

dreamy kestrel
#

what

vestal vector
#

its only one permission

#

so there's no point

dreamy kestrel
#

huh

#

you don't have to do [0]?

vestal vector
#

i mean you could if you wanted the array brackets removed

#

still returns the permission name regardless

dreamy kestrel
#

but I'm pretty sure if you tried to modify it(like concat it) then it wouldn't work(i think)

vestal vector
#

they just want to view the name

#

or could even call .toString() on the .toArray()

dreamy kestrel
#

cool ig