markhenrick / mobilespoilers

A Discord bot for marking images as spoilers from mobile
https://discordapp.com/oauth2/authorize?client_id=699048830112366632&scope=bot&permissions=322624
MIT License
0 stars 0 forks source link

Call endpoints directly when appropriate, without going through JDA's cache #4

Open markhenrick opened 4 years ago

markhenrick commented 4 years ago

For example https://discordapp.com/developers/docs/resources/channel#delete-message All the data needed to attempt to delete a message is contained in the database (except the volatile condition of whether the bot still has access to the channel)

While the docs don't mention it, the fact that JDA::getTextChannelById goes via the GuildCache implies that it would be possible for it to return null for a channel which we do have access to. Regardless, it's possible that this enhancement would allow us to disable the GuildCache completely and save memory