Skip to content

Conversation

@null8626
Copy link
Member

@null8626 null8626 commented Sep 23, 2025

The following pull request is a toned down version of #29 and a continuation of #30. This pull request focuses on the changes done to revert the various breaking changes done to the SDK since update v1.4.1 while also integrating it with newer updates done to v0 like bot reviews.

For a more comprehensive diff since commit a7ed300, see a7ed300...null8626:rust-sdk:split/revert-v2.

The most notable changelog of this pull request is that testing is now done in doctests, instead of a separate unit test file (test.rs.)

Other notable changelogs (since THAT commit):

src/autoposter/mod.rs:

  • Add serenity-cached cfg feature alongside serenity in various parts.
  • Remove the autoposter's wait() feature, so the autoposter is now consistent in its posting without having to wait for newer server counts. This also helps with testing.
  • Remove useless lifetime generic.
  • Add Default implementation.
  • Add receivers support (as per Autoposter ignores errors #23.)
  • The autoposter no longer panics if the given interval is too short, it just corrects the interval to the minimum value.
  • Refactor Deref usage.

src/autoposter/serenity_impl.rs:

  • Use the paste dependency again.

src/autoposter/twilight_impl.rs:

  • Refactor DerefMut usage.

src/bot.rs:

  • Add reviews.
  • Add topgg_id.
  • Ignore discriminator property during deserialization.
  • Ignore guilds property during deserialization.
  • Ignore banner_url property during deserialization.
  • Deprecate approved_at in favor of submitted_at.
  • Ignore shards property during deserialization.
  • Ignore is_certified property during deserialization.
  • Make avatar attribute public.
  • Make vanity attribute public.
  • Make server_count attribute public.
  • Deprecate avatar getter method.
  • Make shard_count getter method always return 0.
  • Add sort support for get_bots.
  • Refactor string concatenation with write!().

src/client.rs:

  • Add token ID destructuring.
  • Handle 400 status codes.
  • Ignore if given server count is 0 or empty in post_stats.
  • Add a page argument to get_voters
  • Use /bots/{id}/votes?page={page} instead of /bots/votes.
  • Deprecate get_user. Now it always fails. (Tried testing it, it always gives 404 now.)

src/error.rs:

  • Add InvalidRequest error type.

src/user:

  • Make avatar attribute public.

src/webhook/actix-web:

  • Return 400 instead of 401.

src/webhook/axum:

  • Return 204 instead of 200.
  • Use tokio's TCPListener instead of Rust's SocketAddr.
  • Use the async-trait dependency directly.

src/webhook/vote.rs:

  • Deprecate is_server.

src/webhook/warp.rs:

  • Return 204 instead of 200.

This branch is already tested and linted (via cargo test, cargo c, cargo clippy, and cargo doc --no-deps.)

@null8626 null8626 mentioned this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant