#delete_message_seconds appears to not be working

1 messages · Page 1 of 1 (latest)

mossy flower
#
let ban = ctx
    .framework
    .twilight_client
    .create_ban(guild_id, punished_user.id)
    .delete_message_seconds(self.purge.value() as u32);
debug!("Purging {:#?} messages!", self.purge.value() as u32);

match reason {
    None => ban.await?,
    Some(ref reason) => ban.reason(reason).await?
};

I have checked the value and its a valid number (number is enforced by enum, not raw user input), but it appears that while the ban works, no messages are deleted. Also tried hardcoding the value as a test and that too does not play ball.

Looking at the logs it seems the request is also working fine, as I can see the API request to delete messages:

2023-08-27T21:30:06.340161Z DEBUG luro::interactions::moderator::ban: Purging 604800 messages!
2023-08-27T21:30:06.340219Z DEBUG twilight_http::client: url="https://discord.com/api/v10/guilds/234815470954348545/bans/938331375759687700?delete_message_seconds=604800"                                                                                                                                   

Bit lost what is up?

carmine igloo
#

could you open an issue addressing this problem, so we can keep track to fix it?

mossy flower
#

https://github.com/twilight-rs/twilight/issues/2271 - Done, thanks!
Tried to take a look to see if I could make a PR with a fix, but for the moment that looks too complex for me

Granted its 4am so I'll probably take another look when I have actually slept rofl

GitHub

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/de...