Discord Roles - Accessing

Hi there,

Whilst the Discord integration is excellent for basic authentication with Discord, I was aiming to retrieve the Discord role information against a user in a guild. Whilst it’s straightforward to add a custom integration and add to the fetch user profile script (thanks for that!), due to the way Discord manages access to role information against a guild, you need to use a bot token to access this information. Would there be any security concerns adding a bot token into the custom fetch user profile script to gain access to the roles and attach it to the profile?

Hi @dunknicoll,

Welcome to the Community!

I am not intimately familiar with the discord APIs, or the discord integration so please take this with that in mind.

What is your concern? Coding a secret directly in the script?

Hi @dan.woda ,

Thanks for replying! No worries re: Discord APIs etc, what you’ve mentioned is exactly my concern. In order to gather the info needed, it appears I would have to include a secret (that’s different from the usual client id + secret) directly in the fetch user profile script (unless theres another way to set environmental variables). Is there any concerns with this approach or should I try a different solution?

Thanks again

1 Like


I don’t think this should be an issue. As you can see in our custom db connection scripts we suggest adding secrets directly in the script. Obviously you should be sure to omit if you managing this code in github or other version control software.

Hi @dan.woda,

Thanks so much for this information! I’ll proceed implementing it this way. Thanks for taking the time to check and respond. Much appreciated!

1 Like

No problem. Let us know if you run into anything else!