twilight-rs / twilight

Powerful, flexible, and scalable ecosystem of Rust libraries for the Discord API.
https://discord.gg/twilight-rs
ISC License
656 stars 130 forks source link

Creating a ban does not delete any messages #2271

Closed nurahwolf closed 11 months ago

nurahwolf commented 1 year ago

Hello!

As per this discord thread, it looks like the method delete_message_seconds of CreateBan is sending the value as a URL parameter, instead of as a JSON body. Reference: https://discord.com/developers/docs/resources/guild#create-guild-ban

While the ban goes through without issue, it does result in no messages being deleted.

To reproduce:

let ban = twilight_client
    .create_ban(guild_id, user_id)
    .delete_message_seconds(6969)
    .await?;

2023-08-27T21:30:06.340219Z DEBUG twilight_http::client: url="https://discord.com/api/v10/guilds/<guild_id>/bans/<user_id>?delete_message_seconds=6969"