DinographicPixels / TouchGuild

TouchGuild is a NodeJS library for interfacing with Guilded.
https://touchguild.com
MIT License
10 stars 6 forks source link

getters: removing requests when uncached. #44

Closed pakkographic closed 1 year ago

pakkographic commented 1 year ago
pakkographic commented 1 year ago

Not sure if it should be merged, it'd make the user experience somehow worse. It'd separate the code in two parts if using message.member for example.

Before:

client.on("messageCreate", (message) => {
   const member = await message.member;
   // anything
});

After:

client.on("messageCreate", (message) => {
     if (message.member instanceof Member){
         // anything
     } else {
        // something else.
     }
});
pakkographic commented 1 year ago

The guided api lacks of information, we cannot rely on cache for now. PR Postponed.

pakkographic commented 1 year ago

solution was found.