-
Notifications
You must be signed in to change notification settings - Fork 597
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
Implement audit_log_reason
argument
#2021
Conversation
The audit log types are no longer re-exported in the `model::guild` module. BREAKING CHANGES: - The `audit_log::Action*` enum sub types are renamed to `*Action`. For instance, `ActionChannel` to `ChannelAction`. - The audit log types must be imported directly from the `model::guild::audit_log` module.
…1893) The newtype struct `gateway::WsClient` hides the WebSocket implementation details and is the first step to remove the `async_tungstenite` & `tungstenite` types from the public API. The `WebSocketGatewayClientExt`, `ReceiverExt` and `SenderExt` trait methods are merged into the implementation of the newtype struct. BREAKING CHANGES: - `gateway::WsStream` is replaced by `gateway::WsClient`. - The `gateway::WebSocketGatewayClientExt` trait is removed.
Since `&` is Copy, it’s useless to have a reference on `Option<&'a [u8]>`.
This changes the return type of `http::Typing::stop` to be a simple `bool` rather than `Option<()>`, which doesn't provide useful information that couldn't be expressed with just a `bool`. Co-authored-by: Michael Krasnitski <42564254+mkrasnitski@users.noreply.github.com> Signed-off-by: Miezhiko <Miezhiko@gmail.com>
This changes instances of `ToString` to `Into<String>` whenever ownership of the `String` is necessary. In case it is not, it's simply changed to `&str` to lessen the effects of monomorphization on compile times.
Problems with the current setup: - The content of messages with these types is not documented, meaning that it can change anytime. - Not every message type is handled, e.g. boost or thread creation messages do not get their content added. - Overall more possibly unexpected behaviour and less consistency with the API.
This adds a method `Webhook::execute_in_thread` which takes an additional thread ID (which is just a `ChannelId`) parameter. Then, the webhook will execute in that thread, provided it belongs to the webhook's assigned guild channel. This also adds a `thread_id` parameter to `Http::execute_webhook`, which is a breaking change.
This also removes `GuildContainer`, as this was (and historically has been) the only use of it.
This replaces the implementation of `From<Ref>` for `CacheRef` with a private method in order to not expose the dashmap type as part of the public API. Also, this rewords and removes a few clones on types returned from the cache.
The interaction payload for autocompletes is slightly different. It's missing the `resolved` data map and reports only for the current autocompleted option value the `focused` field and its value as a string. The focused option value is modeled as an enum variant of `CommandDataOptionValue`. ``` enum CommandDataOptionValue { Autocomplete { name: String, kind: CommandOptionType, value: String }, } ``` The focused option value can be retrieved via `AutocompleteData::focused_option()` from the `AutocompleteData::options` vector.
BREAKING CHANGE: This removes methods only usable on user accounts.
The message cache is currently stored as `DashMap<ChannelId, DashMap<MessageId, Message>>` however since the outer `DashMap` already provides interior mutability, it doesn't need another `DashMap` inside. This also stops dashmap being exposed to the public API via `MessageIterator::Item` by removing it (and instead exposes the inner `HashMap`).
The derive macros are grouped into `std` & third party and sorted alphabetically. ``` #[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)] struct Foo; ```
BREAKING CHANGE: Some enums were missing the `[non_exhaustive]` attribute.
The file was forgotten to delete when the types were moved into the root. See 34bc5fe
The derive macros are grouped into `std` & third party and sorted alphabetically. ``` #[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)] struct Foo; ```
This replaces the `[u64; 2]` shard info with `ShardInfo { id: u32, total: u32 }`. Co-authored-by: nickelc <constantin.nickel@gmail.com>
The `enum_number!` macro now takes the whole enum definition and generates `From` trait implementations to convert a value to the enum and back. The implementations can then be picked up by `serde` with `#[serde(from = "u8", into = "u8")]` to (de)serialize the types. ``` enum_number! { #[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[serde(from = "u8", into = "u8")] pub enum Foo { A = 1, B = 2, _ => Unknown(u8), } } ``` BREAKING CHANGE: The `Unknown` variant now takes the unknown value and the removed `fn num() -> u64` method can be replaced with `let v = u8::from(kind)`.
The returned `Result` is already marked as `#[must_use]`.
Thanks for the PR! Unfortunate timing on your part, I suppose. If you look at |
f06e6e7
to
b6d6ce0
Compare
@SenseiHiraku Now that #2024 has been merged, if you'd like, you can take a stab at re-implementing this (if not let me know and I can tackle it). I think the best way to do so would be to add an optional |
Completed by #2105 |
I've noticed, that adding a reason for the audit_log, as implemented in other Discord API libraries, is not yet fully implemented here.
It may be breaking change for many functions, but it's a necessary one in my eyes, basically an addition to #1354