mathgladiator / adama-lang

A headless spreadsheet document container service.
https://www.adama-platform.com/
GNU Affero General Public License v3.0
106 stars 15 forks source link

Added link to discord api with bot and user token #226

Closed Dependability closed 4 months ago

Dependability commented 7 months ago

This is to add discord service to ADAMA.

Currently, there is no encryption of the token for user tokens and bot tokens. This is dangerous especially for user tokens, as you can reset Bot tokens through discord developer portal, but to change your user token, you must change your password of discord.

Current problems are when you send a delete request, it will send an empty body which is normal, but this will send a route failure error: 128208, which is a document_web_get_cancel error. I am not sure of the cause at this moment.

When there is a problem of any sort that results in the API returning something other than a 200 - 204 status code, the user will only know that something went wrong by the else statement of if as. This may be a bigger issue of the error handling of Adama, but there may be work-arounds such as allowing all requests and the resulting dynamic will have an error key as well as the status code, that would help with debugging as a developer. This is a bit bad though because it goes against the principle of the if-as-else statement and removes the usefulness of else.

There are only a handful of api requests that are implemented, and as a developer, you would have to leverage the discord documentation to figure out what are the keys of your dynamic. This may be able to be better with using messages as the input instead of dynamics, and also working with VSCode, to autofill or show suggestions as it does with other languages.

Next steps are to add a lot more API requests, and maybe work on authentication a bit.