buape / carbon

A fully-featured HTTP library for Discord bots
https://carbon.buape.com/
MIT License
12 stars 6 forks source link

Manually refresh linked roles metadata #181

Open thewilloftheshadow opened 2 weeks ago

thewilloftheshadow commented 2 weeks ago

Right now, Carbon doesn't store any oauth tokens, which you need to be able to manually refresh any metadata on a user without them going through oauth themselves

My first idea for how to do this is to have the user pass in a function that is called when we get a token and then they can store the token themselves somehow (provide examples for Cloudflare kv?), and then provide a refreshMetadata function where they can pass in that token and it will refresh all the metadata that is setup in the plugin.

apteryxxyz commented 1 week ago

Linked roles plugin can maybe have options to pass getter and setters for tokens (get from database, set to database), then have methods and endpoints to use them