Skip to content
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

Upgrade poise current to include poise next and serenity-next #224

Merged
merged 17 commits into from
Nov 28, 2023

Conversation

GnomedDev
Copy link
Member

Discussed on discord.

Copy link
Collaborator

@kangalio kangalio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would have been easier to review with the "merge next into current" and "port to serenity 0.12" split into two PRs, but it's ok

src/modal.rs Outdated Show resolved Hide resolved
src/reply/send_reply.rs Outdated Show resolved Hide resolved
src/structs/framework_error.rs Outdated Show resolved Hide resolved
kangalio and others added 15 commits November 26, 2023 17:12
Only one recursion level deep so far because infinite recursion would have been a pain and I don't even know if that's what users want so it's single recursion level for now and if someone complains I'll go through the async recursion trouble
...and rename AutocompleteChoice.name to label (I think it fits better)
* Rework of builtins::help()

* Use find_command instead of duplicating code

* Fix env variable `set` -> `export` for Unix

* Fix unneeded mut

* cargo fmt

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>
serenity-rs#161 changed single help command to include description. This commit makes it optional (but keeps the new behavior as default)
- category: `Option<&'static str>` -> `Option<String>`
- help_text: `Option<fn() -> String>` -> `Option<String>`
- aliases: `&'static [&'static str]` -> `Vec<String>`
- context_menu_name: `Option<&'static str>` -> `Option<String>`

The &'static references meant you couldn't dynamically change those values which is very powerful so better do this breaking change now than potentially later.
It's not like it hurts to use String and Vec here due to the allocations - every bot will have a two-digit, max three-digit number of Command instances anyways and they will all be initialized on startup.

Also, the fn() in help_text was really ugly and was just a hack for rustbot to share common parts of the help text. But this should be done by just changing the help_text field in main() or whatever. Actually though, I was able to keep the #[command] attribute's help_text_fn field working. But it runs the function at command construction time now instead of on demand when help is called. So, behavior change technically
* Refinements to builtins::help

* Make rustfmt happy

* Make MSRV happy

---------

Co-authored-by: Rogier 'DocWilco' Mulhuijzen <github@bsdchicks.com>
@GnomedDev GnomedDev force-pushed the next-on-current branch 5 times, most recently from 68642b8 to 61ea023 Compare November 28, 2023 13:17
@kangalio kangalio merged commit 835a016 into serenity-rs:current Nov 28, 2023
12 checks passed
@GnomedDev GnomedDev deleted the next-on-current branch November 28, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants