All right, timed out. Got the Lua client mostly written, but it's still buggy:
https://github.com/hishamhm/lua-mastodon

Rewrote the code from Python to Lua in 3 hours (a good deal of it searching for libraries) and another hour trying to figure out this bug with no success yet: https://github.com/hishamhm/lua-mastodon/issues/1

So close!

@hisham_hm Awesome! Good work :pineapple: :pineapple:
@hisham_hm I had this problem when logging in from javascript, but I think it was because I forgot to pass the scopes on login, and it looks like you're doing that correctly
@aeonofdiscord yeah, it seems that my client library is not passing this information, but I tried to force it and no luck. I'll look at the JS client implementation later.