-
Notifications
You must be signed in to change notification settings - Fork 593
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
Add audit log reason support to Http #1354
Conversation
@@ -508,7 +513,7 @@ impl Member { | |||
/// [Ban Members]: Permissions::BAN_MEMBERS | |||
#[inline] | |||
pub async fn unban(&self, http: impl AsRef<Http>) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you add support to the reason message here (and in others structures above)? Is it in WIP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR only adds audit log support to the Http client for simplicity. I will expand the explanation for this in the PR description, hopefully that will clear it up
7a56bbd
to
d1d436e
Compare
eda97c9
to
80fd30f
Compare
This adds support for parsing json with the `simd-json` crate for increased performance. However, it must be enabled with the `simd-json` feature flag, as not all processors support all SIMD instructions. In addition, the minimum-supported Rust version has been increased to 1.49.
Mainly the delete_XX methods because those apparently don't support audit log reasons (undocumented). And also in ban, because the ban reason overwrites any audit log reason
Can you resolve conflicts? Otherwise lgtm |
A second attempt at #296.
This PR only adds audit log reason support to the Http client. Model methods like
Member::unban
orGuildChannel::edit
still cannot be provided with an audit log reason. This was done because:Option<&str>
parameter to all the methods? That's a big breaking change and requires users to litterNone
function arguments all over the placeI tested this by making a small test bot that invokes roughly half of all modified Http functions. The audit log in the server settings shows the correct reason strings. I couldn't test the other half of Http functions because I couldn't really figure out how to invoke them easily.
Unfortunately, Discord apparently doesn't properly document which HTTP routes support an audit log reason and which don't. I was using this table as a guideline, but probably there are some API routes where I falsely added or falsely omitted audit log support.