8000 Ensure maximum Discord-API mimickry · Issue #584 · polyphony-chat/chorus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ensure maximum Discord-API mimickry #584

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

Open
8000
bitfl0wer opened this issue Dec 24, 2024 · 2 comments
Open

Ensure maximum Discord-API mimickry #584

bitfl0wer opened this issue Dec 24, 2024 · 2 comments
Labels
Difficulty: Complex Priority: High Type: Enhancement Enhances an existing feature or behaviour.
Milestone

Comments

@bitfl0wer
Copy link
Member

chorus should, ideally, behave exactly like a Discord Client when interacting with Spacebar-Compatible APIs. This means that every WebSocket message, every API call, every field in every JSON sent should ideally 100% match what Discord are doing on their Client.

@bitfl0wer bitfl0wer added Priority: High Type: Enhancement Enhances an existing feature or behaviour. Difficulty: Complex labels Dec 24, 2024
@bitfl0wer bitfl0wer added this to the 1.0.0 milestone Dec 24, 2024
@kozabrada123
Copy link
Member

Honestly this feels like more of a guiding principle rather than a goal to achieve - complete mimicry is realistically impossible, but there are a few things we could do to be less identifiable

@kozabrada123
Copy link
Member
kozabrada123 commented Dec 28, 2024

to name a few:

  • we should provide a user agent for the http api (probably not following discord's guidelines)
  • Client properties have changed,
  • we should also send them as X-Super-Properties
  • potentially we can have these properties stored for each ChorusUser, which can be either left at safe defaults or set by library consumers as they please

kozabrada123 added a commit that referenced this issue Mar 15, 2025
Release tracker for v0.19.0 of chorus

It's been nearly 4 months, but they have been quite busy!

Major additions in this version include:
- the finished guild api (39 new routes + several new entities - #593), 
- a robust api for managing sent (fake) telemetry data (adding
`X-Super-Properties` and `User-Agent` headers, bringing us a bit closer
to #584 - #590),
- an api for awaiting responses to gateway send events (which also adds
two pre-made observers for receiving events through `tokio` channels -
#591) and
- an api for setting the default gateway listeners for spawned gateways
from `Instance` (#598)

## Public API changes
- each `Instance` now contains a `client_properties` property, which
lets api consumers set data sent as telemetry to the instance. Setting
`client_properties.send_telemetry_headers` (the only field which is not
directly serialized) to false will disable sending certain headers which
contain this data in requests, but sending the very same data when
opening a Gateway connection cannot be disabled. Further, disabling this
isn't recommended due to privacy reasons. (The server expects to find
these headers, which may identify users using your app)
- each `Instance` now also contains a `default_gateway_events` property,
which is cloned for each new Gateway the Instance spawns. This also
makes Gateway Events are clonable.
- `GatewayError::NoResponse` as part of the gateway in-place events api
- Proper Gateway Intents and Capabilities types (#595 by @Quat3rnion)
- Add `UserStatus` variant "Unknown" (#596 by @bitfl0wer)
- changed `read_state` in Gateway Ready to an enum which now includes
the new way discord.com serializes it as (A Vec of `ReadStateEntry`) and
the old way it did and Spacebar still does
- added `GuildFeatures` variants `ActivityFeedDisabledByUser`,
`ChannelIconEmojisGenerated`,
`EnabledModerationExperienceForNonCommunity`, `Featurable`,
`PrivateThreads`
- changed `Reaction`'s `Emoji` to `PartialEmoji`, as per userdoccers
- changed `Message` `Reaction` events to use `PartialEmoji`, as per
userdoccers
- `Guild::get` - add `with_counts` parameter
- `Guild::create` - update schema for new fields, see
spacebarchat/server#1251
- `Guild::modify` - update schema, add `audit_log_reason`
- `Guild::get_members` - update query parameters
- rename `Guild::search_members` to `Guild::query_members`, since search
members is another different route
- `Guild::query_members` - update query parameters
- `Guild::modify_member` - update fields of schema ( + documentation)
- `Guild::modify_current_member` - update fields of schema ( +
documentation)
- `Guild::modify_current_member_profile` - update fields of schema ( +
documentation)
- update `Activity` type, make fields and types public

## Additions
- #593 - 39 new Guild API routes
- #590 - see `Instance.client_properties` and `ClientProperties`
- #591 - `identify`, `resume, request_guild_members`,
`update_voice_state`, `request_last_messages` as methods that can be
`await`ed to receive the response from the server;
`OneshotEventObserver<T>` and `BroadcastEventObserver<T>`
- #598 - `Instance.default_gateway_events`

## Bugfixes
- #589 (#592)
- fix an issue with `.well-known` discovery of Instances not working
(ba42169)
- `Guild::get_preview` fix: method is GET, not PATCH
- fix a few `repr` enums not using `Serialize_repr` and
`Deserialize_repr` and such causing deserialization errors
- changed `Reaction`'s `Emoji` to `PartialEmoji`, as per userdoccers, to
fix a deserialization error
- changed `Message` `Reaction` events to use `PartialEmoji`, as per
userdoccers, to fix a deserialization error

## Internal changes
- add methods `with_audit_log_reason`, `with_maybe_audit_log_reason`,
`with_authorization`, `with_authorization_for`, `with_headers_for` to
`ChorusRequest`
- update license headers, fix missing license headers (84f3415 by
@bitfl0wer)
- Add license-header check workflow (7e70029 by @bitfl0wer)
- Try to fix errors in our doctests, so they can actually be tested in
the future (testing framework still needs to be updated)
- add `bytes` as a dependency, so we can access its types - this does
not actually add to compilation, as other important dependencies (http,
reqwest, sqlx, tokio_tungstenite, ...) depend on the same version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Complex Priority: High Type: Enhancement Enhances an existing feature or behaviour.
Projects
None yet
Development

No branches or pull requests

2 participants
0