From 10025cf5b64274622a5923d83495a147be8ca399 Mon Sep 17 00:00:00 2001 From: kangalioo Date: Mon, 10 Oct 2022 00:03:41 +0200 Subject: [PATCH] Bump to 0.4.0 --- CHANGELOG.md | 37 ++++++++++++++++++ Cargo.lock | 98 +++++++++++++++++++++++++++++------------------ Cargo.toml | 4 +- macros/Cargo.toml | 2 +- 4 files changed, 101 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a00659b83b5..002118cd8dbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +# 0.4.0 + +New features: +- Added std::error::Error impl for FrameworkError +- Added `FrameworkError::discord() -> &serenity::Context` method +- Added `FrameworkError::ctx() -> Option` method +- Added `FrameworkError::handle()` method which calls the appropriate on_error function on itself +- Added Copy and Clone impl for PartialContext +- Added `ReplyHandle::delete()` +- Added `FrameworkError::UnknownCommand` and `FrameworkError::UnknownInteraction` + - These error cases would previously just `log::warn!()` +- Exposed internals of `dispatch_message()` as new functions `parse_invocation()` and `run_invocation()` +- Added trigger and action callback to PrefixContext +- Made EditTracker methods public: `process_message_update()`, `set_bot_response()`, `track_command()` + +API updates: +- Added or changed fields of some FrameworkError enum variants +- Removed `cmd: &Command` parameter from check_permissions_and_cooldown (Context already includes it) +- triggered_by_edit and previously_tracked bool parameters replaced by new MessageDispatchTrigger enum +- Simplified return type of `dispatch_message()`, `dispatch_interaction()`, and `dispatch_autocomplete()` to `Result<(), FrameworkError>` +- Simplified return type of `extract_command_and_run_checks()` to `Result` +- Removed `futures_core` re-export + +Behavior changes: +- Internal warnings now use `log::warn!()`/`log::error!()` instead of `eprintln!()` + - That way, you can mute them or handle them specially +- Default `FrameworkError::DynamicPrefix` handler now prints message content +- `ReplyHandle::edit()` now replaces existing attachments and embeds instead of adding on top +- Cooldowns are now triggered before command execution instead of after +- Added `log::warn!()` in some weird code paths that shouldn't be hit +- When a focused autocomplete option has an unrecognized name and when the autocomplete value is not a string, `FrameworkError::CommandStructureMismatch` is now thrown + - Instead of discarding the error +- `register_application_commands_buttons()` switched order of rows + - Guild-specific actions are at the top because they are more common and less destructive + +Detailed changelog: https://github.com/kangalioo/poise/compare/v0.3.0...v0.4.0 + # 0.3.0 New features: diff --git a/Cargo.lock b/Cargo.lock index 801145383124..f1424f3a320b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -650,34 +650,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "miow", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", + "windows-sys 0.36.1", ] [[package]] @@ -753,7 +733,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.34.0", ] [[package]] @@ -776,7 +756,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "poise" -version = "0.3.0" +version = "0.4.0" dependencies = [ "async-trait", "derivative", @@ -798,7 +778,7 @@ dependencies = [ [[package]] name = "poise_macros" -version = "0.3.0" +version = "0.4.0" dependencies = [ "darling", "proc-macro2", @@ -871,9 +851,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -882,9 +862,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "reqwest" @@ -1207,10 +1187,11 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.17.0" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ + "autocfg", "bytes", "libc", "memchr", @@ -1592,11 +1573,24 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] [[package]] @@ -1605,30 +1599,60 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_i686_gnu" version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_msvc" version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_x86_64_gnu" version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_msvc" version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "winreg" version = "0.10.1" diff --git a/Cargo.toml b/Cargo.toml index 4e51c80a7c6c..3b5446784c3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ authors = ["kangalioo "] edition = "2018" name = "poise" -version = "0.3.0" +version = "0.4.0" description = "A Discord bot framework for serenity" license = "MIT" repository = "https://github.com/kangalioo/poise/" @@ -12,7 +12,7 @@ tokio = { version = "1.21.1", default-features = false } # for async in general futures-core = { version = "0.3.13", default-features = false } # for async in general futures-util = { version = "0.3.13", default-features = false } # for async in general once_cell = { version = "1.7.2", default-features = false, features = ["std"] } # to store and set user data -poise_macros = { path = "macros", version = "0.3.0" } # remember to update the version on changes! +poise_macros = { path = "macros", version = "0.4.0" } # remember to update the version on changes! async-trait = { version = "0.1.48", default-features = false } # various traits regex = { version = "1.6.0", default-features = false, features = ["std"] } # prefix log = { version = "0.4.14", default-features = false } # warning about weird state diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 23a63e9b4320..c39425084b25 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "poise_macros" -version = "0.3.0" # remember to update the version +version = "0.4.0" # remember to update the version authors = ["kangalioo "] edition = "2018" description = "Internal macro implementation crate of poise"