Open JDJGInc opened 1 year ago
https://github.com/JDsProjects/JDBot/commit/0bf964b9316a92c9e280493d7f42f023f148e0b4
brings up the schema here.
everywhere -> user id guild -> guild id dm -> the user's dm channel id, Well user id works too I guess? channel -> channel id
Note, it's everywhere as global in python is already used.
view for the invalidation config selector.
an opt out mood for those who are global will be made too, so another table will be made.
CREATE TABLE invalidation_out (
entity_id bigint NOT NULL,
entity_type smallint NOT NULL,
PRIMARY KEY (entity_id, entity_type)
);
All enum values are valid.
i thought everywhere and dm could be ignored but that makes no sense.
Instead of TokenInvalidatorSettings, it may be better as slash.
Bard's weird explanation that someone tried to give me but was somewhat helpful:
## Chat Summary (Bard and User):
**Topic:** Creating a custom cache for DPY with invalidation logic
**Key Points:**
- User needs to cache data from two tables (`invalidation_config` and `invalidation_out`) efficiently, prioritizing opt-out data over configurations.
- Caching uses `@functools.lru_cache` and custom methods for `InvalidateType` enums.
- User wants:
- Object and helper methods for DPY.
- Opt-out data always considered with higher priority.
- Users can still manually invalidate tokens even when opted out.
**Solutions:**
- Provided `InvalidationCache` object with helper methods like `is_invalidated` and `is_token_invalidated`.
- Updated `is_invalidated` to prioritize opt-out data.
- Suggested adding `invalidate_token` method for manual invalidation.
- Advised on database interactions, error handling, and testing.
**Additional points:**
- User can export chat using various methods (copy-paste, browser tools, extensions).
- Chat summary provided for easy reference.
I hope this concise summary is helpful for you!
As in google bard.
HMMM
Opt in:
types:
global - for you everywhere (a.k.a the user who optted in) guild -> for that guild(guild owner only) and then for that channel if you have proper permissions (invalidation config a.k.a token invalidation)