partial broken fix for optional parameters (mostly message and reproxy commands)

This commit is contained in:
dusk 2025-11-27 00:40:53 +00:00
parent 81e0cebb8e
commit 3c59ad62bd
No known key found for this signature in database
6 changed files with 71 additions and 53 deletions

View file

@ -1,7 +1,7 @@
use super::*;
pub fn cmds() -> impl Iterator<Item = Command> {
let message = tokens!(("message", ["msg", "messageinfo"]), MessageRef);
let message = tokens!(("message", ["msg", "messageinfo"]), Optional(MessageRef));
let author = ("author", ["sender", "a"]);
let delete = ("delete", ["del", "d"]);
@ -20,19 +20,16 @@ pub fn cmds() -> impl Iterator<Item = Command> {
};
[
apply_edit(command!(edit, Optional(MessageRef), new_content_param => "message_edit")),
command!(reproxy, Optional(("msg", MessageRef)), ("member", MemberRef) => "message_reproxy")
.help("Reproxies a message with a different member"),
command!(message, author => "message_author").help("Shows the author of a proxied message"),
command!(message, delete => "message_delete").help("Deletes a proxied message"),
apply_edit(command!(message, edit, new_content_param => "message_edit")),
command!(message => "message_info")
.flag(delete)
.flag(author)
.help("Shows information about a proxied message"),
command!(message, author => "message_author").help("Shows the author of a proxied message"),
command!(message, delete => "message_delete").help("Deletes a proxied message"),
apply_edit(command!(message, edit, new_content_param => "message_edit_specified")),
apply_edit(command!(edit, Skip(MessageRef), new_content_param => "message_edit_specified")),
apply_edit(command!(edit, new_content_param => "message_edit")),
command!(reproxy, ("member", MemberRef) => "message_reproxy")
.help("Reproxies a message with a different member"),
command!(reproxy, ("msg", MessageRef), ("member", MemberRef) => "message_reproxy_specified")
.help("Reproxies a message with a different member"),
]
.into_iter()
}