Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does this work in the backend? #1

Open
Hunter2809 opened this issue Mar 13, 2021 · 4 comments
Open

How does this work in the backend? #1

Hunter2809 opened this issue Mar 13, 2021 · 4 comments

Comments

@Hunter2809
Copy link

Hi there!

I want to know, as to how does the backend code works. Like, if I select only, manage server and manage messages permissions, how will it calculate them? What's the code for each permission, and how does permission selection works?

Thanks in advance!!

@Hunter2809
Copy link
Author

@AraHaan you there?

@AraHaan
Copy link
Member

AraHaan commented Mar 16, 2021

Well it's been a long time since I last update it but the ones currently in should still work, just lacks the newer permissions from discord.

And how it works is it takes the numbers generated by the api to calculate the permissions. So the values internally are hard coded in as shown in https://github.com/AraHaanOrg/DiscordCalc/blob/master/DiscordCalc/permissionscalc.py. I use eval with the actual hex values to convert them to normal ints.

@AraHaan
Copy link
Member

AraHaan commented Mar 16, 2021

Also see https://discordapi.com/permissions.html for all of the values as well to check which ones are already in.

@AraHaan
Copy link
Member

AraHaan commented Mar 16, 2021

Alright I just updated them to add missing permissions added since the original time this was made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants