Skip to content

Commit

Permalink
docs: change "client" to "bot"
Browse files Browse the repository at this point in the history
  • Loading branch information
AwesomeStickz committed Aug 13, 2024
1 parent eba0b9f commit d23e0a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ Each cache will be in their own property under `bot.cache` and each of them have

# **Important Things To Note:**

- Make sure to include the correct `client.transformers.desiredProperties` somewhere in your code, this must include at least **all** the properties from `client.cache.options.desiredProps` for it to cache all those properties you want to cache.
- It's not recommended to dynamically change `client.cache.options.cacheInMemory` or `client.cache.options.cacheOutsideMemory` since it may not cache newly added cache if events for that isn't setup. If you need to do so, you need to manually rerun the `setupDummyEvents` function.
- You should also avoid directly replacing `client.events` (like `client.events = { ready: ReadyFunction }`) since it'll override the dummy events setup by the cache proxy, which may make it unable to cache data. Instead, assign to individual event properties, like `client.events.ready = ReadyFunction`, `client.events.messageCreate = MessageCreateFunction` etc.
- Make sure to include the correct `bot.transformers.desiredProperties` somewhere in your code, this must include at least **all** the properties from `bot.cache.options.desiredProps` for it to cache all those properties you want to cache.
- It's not recommended to dynamically change `bot.cache.options.cacheInMemory` or `bot.cache.options.cacheOutsideMemory` since it may not cache newly added cache if events for that isn't setup. If you need to do so, you need to manually rerun the `setupDummyEvents` function.
- You should also avoid directly replacing `bot.events` (like `bot.events = { ready: ReadyFunction }`) since it'll override the dummy events setup by the cache proxy, which may make it unable to cache data. Instead, assign to individual event properties, like `bot.events.ready = ReadyFunction`, `bot.events.messageCreate = MessageCreateFunction` etc.

# Useful Options To Note:

Expand Down
1 change: 1 addition & 0 deletions setupCacheRemovals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const setupCacheRemovals = <B extends Bot>(bot: BotWithProxyCache<ProxyCa

bot.handlers.GUILD_MEMBER_REMOVE = (_, data, shardId) => {
const payload = data.d as DiscordGuildMemberRemove;

GUILD_MEMBER_REMOVE(bot, data, shardId);

bot.cache.members.delete(bot.transformers.snowflake(payload.user.id), bot.transformers.snowflake(payload.guild_id));
Expand Down

0 comments on commit d23e0a7

Please sign in to comment.