fix message edit commands, parse DM message links for ids

This commit is contained in:
dusk 2025-10-13 10:25:55 +00:00
parent 134855f8f8
commit a307dd37c4
No known key found for this signature in database
6 changed files with 74 additions and 47 deletions

View file

@ -7,7 +7,7 @@ pub fn cmds() -> impl Iterator<Item = Command> {
let delete = ("delete", ["del", "d"]);
let reproxy = ("reproxy", ["rp", "crimes", "crime"]);
let edit = tokens!(("edit", ["e"]), ("new_content", OpaqueStringRemainder));
let edit = ("edit", ["e"]);
let apply_edit = |cmd: Command| {
cmd.flag(("append", ["a"]))
.flag(("prepend", ["p"]))
@ -25,8 +25,9 @@ pub fn cmds() -> impl Iterator<Item = Command> {
.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 => "message_edit")),
apply_edit(command!(edit => "message_edit")),
apply_edit(command!(message, edit, ("new_content", OpaqueStringRemainder) => "message_edit_specified")),
apply_edit(command!(edit, Skip(MessageRef), ("new_content", OpaqueStringRemainder) => "message_edit_specified")),
apply_edit(command!(edit, ("new_content", OpaqueStringRemainder) => "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")