Learn to Code via Tutorials on Repl.it!

← Back to all posts
Discord Permissions List (Array form)
almostStatic (106)

Discord Permissions List (In Array Form)

Ever making a command in your discord.js bot and realise that you suddenly need an array containing all of the Discord Permissions?Well, I've got you covered.

  'EMBED_LINKS',           'ATTACH_FILES',
  'CONNECT',               'SPEAK',
  'MOVE_MEMBERS',          'USE_VAD',

You can utilise the .map() and .join() methods to map them into a more readable list. In order to replace ALL the _, you will need to utilise a for loop.

I will later create a more in-depth guide to using .map() and .join() later.

Additionally, you can access these permissions directly via Object.keys(require('discord.js').Permissions.FLAGS). You must be on v12.

PixelNinja (311)

Ty, I will favorite this post so I can easily get to it.