SinisterRectus / Discordia

Discord API library written in Lua for the Luvit runtime environment
MIT License
688 stars 144 forks source link

Fix permissions on arm processors and prepare for permissions change #386

Open truemedian opened 1 year ago

truemedian commented 1 year ago

Works around a bug in luajit that seems to happen when passing a number to bit.bor that is larger than 2^31-1

Additionally adds a few missing enumerations so that enableAll and disableAll work as expected.

Fixes https://github.com/SinisterRectus/Discordia/issues/384

Also forces permissions to be sent as a string, in preparation for when they'll no longer be allowed to be sent as a number.

MeteorTheLizard commented 1 year ago

I've been using this fix for a few weeks now and it has seen a lot of use. So far there haven't been any problems with it, though through testing I found out that when there is an enum missing in libs/enums.lua (for example when discord decides to add a new one on their end), then the permission management breaks again.

SinisterRectus commented 1 year ago

It looks like this changes the enum type from number to LJ int. Not ideal, but is there no better way?