| 1 |
\page using-cache Using Cache |
| 2 |
|
| 3 |
Sometimes you may need information that is not directly available in the event callback object. |
| 4 |
|
| 5 |
To handle this DPP maintains a cache of commonly used data for you. |
| 6 |
|
| 7 |
@note As of August 30th, 2022, Discord made Guild Members a privileged intent. You must have GUILD_MEMBERS intent enabled for your app from discord developers portal to be able to look for members in cache. |
| 8 |
|
| 9 |
Below is an example showing how to get a user from the cache |
| 10 |
|
| 11 |
\include{cpp} using_cache.cpp |
| 12 |
|
| 13 |
DPP caches more than just users, which you can get using the below-mentioned functions: |
| 14 |
- `dpp::find_role()` |
| 15 |
- `dpp::find_channel()` |
| 16 |
- `dpp::find_emoji()` |
| 17 |
- `dpp::find_guild()` |
| 18 |
- `dpp::find_guild_member()` |