Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

feature: catnip v3 and API v8 support #482

Merged
merged 128 commits into from
Mar 20, 2021
Merged

feature: catnip v3 and API v8 support #482

merged 128 commits into from
Mar 20, 2021

Conversation

queer
Copy link
Member

@queer queer commented Sep 29, 2020

As this makes some backwards-incompatible changes, this is a major version bump.

This is a WIP based off of discord/discord-api-docs#2097.

Note: The branch name is a little funny because I had started on v8 work, then realised it was full of breaking changes, so figured I'd do a version bump, so...


An overview of changes

  • API v8 is the minimum required version. All the related v8 changes have been added, see the linked PR above.
  • Intents will actually warn properly if you're using them incorrectly now.
  • API version and intents are sanity-checked.
  • DM channels are no longer cached; they're fetched on-demand as needed.
  • ALL cache-related methods, and anything that touches them, return Rx operators instead of entities/values directly.
  • Member chunking is disabled by default.
  • Missing guild features added.
  • Support for stickers!!!!!!!!!!!!!!1 (Support stickers #490).
  • More sanity checking of config.
  • Missing message types added.
  • Mention flags on edits (Support mention parse flags on message edit #435).
  • Support for inline message replies (Add message type 19 REPLY #481, Support inline replies #484).
  • Return Maybe instead of Single where it makes sense.
  • Convenience method in RxHelpers to await a lot of Maybes and Singles.
  • Add Message#reply().
  • Rename RestChannel#sendMessage() to #createMessage() to match what's in the docs properly.
  • Fix the examples to work with v3.
  • Fix Member#mute()/deaf() (Member#mute()/deaf() don't work #489).
  • Add proper support for new JSON errors.
  • Decompose entities into interfaces that can reduce code duplication.
  • Much better tests and the like via GitHub Actions.
  • e2e testing to verify that (some) REST stuff actually works.
  • Caches do the right thing without raising NPEs.
  • Logging is a bit more configurable.
  • Noop caches will no longer log spurious errors.
  • Cache workers can now specify what entities they can provide history for. This fixes some DoubleEvent exceptions.
  • CHANNEL_UPDATE is now a DoubleEvent the way it should have been.
  • Cache flags are gone, as intents are an effective replacement for them.
  • A lot more convenience methods!
  • Support for inline replies.
  • Interactions (currently just slash commands) are supported!!! (feature: interactions #500).
  • Catnip#on() is now private, to push people towards using Rx operators properly.

Q. Why does <this method> return an Rx operator, but <that method> returns an entity class?
A. This is due to how the Discord API works, and the points at which it does/not actually provide an entity.

Q. Returning Rx operators for every cache method is stupid and painful and bad you absolute moron.
A. That's not really a question, but unless you're doing some special caching stuff, you can wrap them in methods that block, or just use #blockingGet() everywhere, or... to get the old blocking behaviour. The reason for it being this way is because ex. a remote entity cache in Redis shouldn't block during the network round trips.

@queer queer added enhancement New feature or request new discord feature New feature Discord is adding; may need time before adding support v2 Marks issues specifically about v2 labels Sep 29, 2020
@queer queer marked this pull request as draft September 29, 2020 01:47
@queer queer removed the v2 Marks issues specifically about v2 label Sep 29, 2020
@queer queer changed the title feature: API v8 support feature: catnip v3 and API v8 support Sep 29, 2020
@queer queer added the v3 Marks issues/PRs specifically about v3 label Sep 29, 2020
@queer
Copy link
Member Author

queer commented Sep 29, 2020

APIv8 docs have been merged, so choo choo 🚂

@queer queer marked this pull request as ready for review September 29, 2020 23:22
queer and others added 28 commits December 16, 2020 12:53
…json object so no deserialization needed. Maybe in future direct fetch of role, channel and user ids.
…ommandInteractionDataOption.java

Co-authored-by: amy null <null@amy.gg>
Fixed type read out of InteractionDataOption and added the value.
@queer queer merged commit 4665f72 into master Mar 20, 2021
@queer queer deleted the feature/api-v8 branch March 20, 2021 17:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request new discord feature New feature Discord is adding; may need time before adding support v3 Marks issues/PRs specifically about v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants