Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add CacheSettings.only_my_member #1679

Merged
merged 20 commits into from
Aug 10, 2023

Conversation

Le0Developer
Copy link
Contributor

@Le0Developer Le0Developer commented Aug 4, 2023

Summary

Add CacheSettings.only_my_member to restrict the member cache to only cache the bot.
This is useful for situations when you only need the bot member (eg permission calculations).

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

Closes #1678

@Le0Developer Le0Developer marked this pull request as ready for review August 4, 2023 20:57
@Le0Developer Le0Developer changed the title feat: add CacheComponents.MY_MEMBER feat: add CacheSettings.only_cache_my_member Aug 4, 2023
davfsa
davfsa previously approved these changes Aug 4, 2023
Copy link
Member

@davfsa davfsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

hikari/api/config.py Outdated Show resolved Hide resolved
hikari/api/config.py Show resolved Hide resolved
changes/idk.feat.md Outdated Show resolved Hide resolved
@Le0Developer Le0Developer changed the title feat: add CacheSettings.only_cache_my_member feat: add CacheSettings.only_my_member Aug 5, 2023
@davfsa davfsa added the enhancement New feature or request label Aug 5, 2023
hikari/impl/event_manager.py Outdated Show resolved Hide resolved
Copy link
Member

@davfsa davfsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good (unless I missed something)

@FasterSpeeding FasterSpeeding merged commit 70f85b9 into hikari-py:master Aug 10, 2023
20 checks passed
davfsa added a commit to davfsa/hikari that referenced this pull request Sep 28, 2023
* Bump benjefferies/branch-protection-bot from 1.0.8 to 1.0.9 (hikari-py#1664)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add code block in `hikari.embeds`'s docs (hikari-py#1667)

* Bump wheel from 0.40.0 to 0.41.0 (hikari-py#1668)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sphinx from 7.0.1 to 7.1.0 (hikari-py#1669)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump furo from 2023.5.20 to 2023.7.26 (hikari-py#1670)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sphinx from 7.1.0 to 7.1.1 (hikari-py#1671)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Automatically rename changelog fragments that start with idk (hikari-py#1663)

* Remove renaming "idk" changelog files  (hikari-py#1674)

* Bump flake8 from 6.0.0 to 6.1.0 (hikari-py#1672)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: davfsa <[email protected]>

* Fix incorrect calculation for the default avatar of migrated users (hikari-py#1673)

* Bump slotscheck from 0.16.5 to 0.17.0 (hikari-py#1675)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sphinx from 7.1.1 to 7.1.2 (hikari-py#1676)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.317 to 1.1.320 (hikari-py#1677)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix not handling `null` `last_message_id` when deserializing stage channels (hikari-py#1680)

* Bump wheel from 0.41.0 to 0.41.1 (hikari-py#1681)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add with_counts information for OwnGuilds (hikari-py#1659)

* Fix the uses of `deprecated` directive and fix deadlinks to `GatewayBot` (hikari-py#1682)

* feat: add CacheSettings.only_my_member (hikari-py#1679)

Co-authored-by: davfsa <[email protected]>

* Bump mypy from 1.4.1 to 1.5.0 (hikari-py#1685)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.320 to 1.1.321 (hikari-py#1684)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump async-timeout from 4.0.2 to 4.0.3 (hikari-py#1686)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.321 to 1.1.322 (hikari-py#1688)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump coverage[toml] from 7.2.7 to 7.3.0 (hikari-py#1689)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pytest-randomly from 3.13.0 to 3.14.0 (hikari-py#1690)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.322 to 1.1.323 (hikari-py#1692)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pytest-randomly from 3.14.0 to 3.15.0 (hikari-py#1691)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mypy from 1.5.0 to 1.5.1 (hikari-py#1694)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump wheel from 0.41.1 to 0.41.2 (hikari-py#1698)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.323 to 1.1.324 (hikari-py#1699)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump furo from 2023.7.26 to 2023.8.19 (hikari-py#1697)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sphinx from 7.1.2 to 7.2.4 (hikari-py#1701)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: FasterSpeeding <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: FasterSpeeding <[email protected]>

* Bump sphinx from 7.2.4 to 7.2.5 (hikari-py#1704)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.324 to 1.1.325 (hikari-py#1703)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/checkout from 3 to 4 (hikari-py#1707)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add missing audit log event types (hikari-py#1705)

* Fix attachments not being removed in message edits (hikari-py#1702)

* Bump pytest from 7.4.0 to 7.4.1 (hikari-py#1706)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump coverage[toml] from 7.3.0 to 7.3.1 (hikari-py#1708)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.325 to 1.1.326 (hikari-py#1710)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pytest from 7.4.1 to 7.4.2 (hikari-py#1711)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add `approximate_guild_count` field to own `Application` (hikari-py#1712)

* Add custom status support (hikari-py#1683)

* Prepare for release of 2.0.0.dev121 (hikari-py#1713)

Co-authored-by: hikari-bot <90276125+hikari-bot[bot]@users.noreply.github.com>

* Bump to development version (2.0.0.dev122)

* Bump black from 23.7.0 to 23.9.1 (hikari-py#1714)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump furo from 2023.8.19 to 2023.9.10 (hikari-py#1715)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump tibdex/github-app-token from 1 to 2 (hikari-py#1716)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.326 to 1.1.327 (hikari-py#1718)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sphinx from 7.2.5 to 7.2.6 (hikari-py#1717)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix ["revoked"] KeyError for `deserialize_own_connection` (hikari-py#1720)

Signed-off-by: Nick <[email protected]>
Co-authored-by: FasterSpeeding <[email protected]>

* Bump flake8-isort from 6.0.0 to 6.1.0 (hikari-py#1719)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sphinx-autoapi from 2.1.1 to 3.0.0 (hikari-py#1722)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump numpydoc from 1.5.0 to 1.6.0 (hikari-py#1721)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pyright from 1.1.327 to 1.1.329 (hikari-py#1724)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add lock files

- Purposely downgrade flake8

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: FasterSpeeding <[email protected]>
Signed-off-by: Nick <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: PythonTryHard <[email protected]>
Co-authored-by: Leo Developer <[email protected]>
Co-authored-by: FasterSpeeding <[email protected]>
Co-authored-by: Nova <[email protected]>
Co-authored-by: hikari-bot[bot] <90276125+hikari-bot[bot]@users.noreply.github.com>
Co-authored-by: Nick <[email protected]>
yakMM pushed a commit to yakMM/hikari that referenced this pull request Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to only cache the bot member
3 participants