mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 14:57:54 +00:00
implement proxied message and permcheck commands
This commit is contained in:
parent
2b304457cc
commit
e4f38c76a9
19 changed files with 233 additions and 155 deletions
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -1 +1,16 @@
|
|||
use super::*;
|
||||
|
||||
pub fn debug() -> (&'static str, [&'static str; 1]) {
|
||||
("debug", ["dbg"])
|
||||
}
|
||||
|
||||
pub fn cmds() -> impl Iterator<Item = Command> {
|
||||
let debug = debug();
|
||||
let perms = ("permissions", ["perms", "permcheck"]);
|
||||
[
|
||||
command!(debug, perms, ("channel", ["ch"]), ChannelRef => "permcheck_channel"),
|
||||
command!(debug, perms, ("guild", ["g"]), GuildRef => "permcheck_guild"),
|
||||
command!(debug, ("proxy", ["proxying", "proxycheck"]), MessageRef => "message_proxy_check"),
|
||||
]
|
||||
.into_iter()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ use super::*;
|
|||
pub fn cmds() -> impl Iterator<Item = Command> {
|
||||
let help = ("help", ["h"]);
|
||||
[
|
||||
command!("explain" => "explain"),
|
||||
command!(help => "help")
|
||||
.flag(("foo", OpaqueString)) // todo: just for testing
|
||||
.help("Shows the help command"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
pub mod admin;
|
||||
pub mod api;
|
||||
pub mod autoproxy;
|
||||
pub mod checks;
|
||||
pub mod commands;
|
||||
pub mod config;
|
||||
pub mod dashboard;
|
||||
|
|
@ -33,6 +32,8 @@ pub fn all() -> impl Iterator<Item = Command> {
|
|||
.chain(random::cmds())
|
||||
.chain(api::cmds())
|
||||
.chain(autoproxy::cmds())
|
||||
.chain(debug::cmds())
|
||||
.chain(message::cmds())
|
||||
.map(|cmd| {
|
||||
cmd.hidden_flag(("plaintext", ["pt"]))
|
||||
.hidden_flag(("raw", ["r"]))
|
||||
|
|
|
|||
|
|
@ -1 +1,32 @@
|
|||
use super::*;
|
||||
|
||||
pub fn cmds() -> impl Iterator<Item = Command> {
|
||||
let message = tokens!(("message", ["msg", "messageinfo"]), MessageRef);
|
||||
|
||||
let edit = tokens!(("edit", ["e"]), ("new_content", OpaqueStringRemainder));
|
||||
let apply_edit = |cmd: Command| {
|
||||
cmd.flag(("append", ["a"]))
|
||||
.flag(("prepend", ["p"]))
|
||||
.flag(("regex", ["r"]))
|
||||
.flag(("mutate-space", ["ms"]))
|
||||
.flag(("clear-embeds", ["ce"]))
|
||||
.flag(("clear-attachments", ["ca"]))
|
||||
.help("Edits a proxied message")
|
||||
};
|
||||
|
||||
[
|
||||
command!(message => "message_info")
|
||||
.flag(("delete", ["d"]))
|
||||
.flag(("author", ["a"]))
|
||||
.help("Shows information about a proxied message"),
|
||||
command!(message, ("author", ["sender"]) => "message_author")
|
||||
.help("Shows the author of a proxied message"),
|
||||
command!(message, ("delete", ["del"]) => "message_delete")
|
||||
.help("Deletes a proxied message"),
|
||||
apply_edit(command!(message, edit => "message_edit")),
|
||||
apply_edit(command!(edit => "message_edit")),
|
||||
command!(("reproxy", ["rp", "crimes", "crime"]), MessageRef => "message_reproxy")
|
||||
.help("Reproxies a message with a different member"),
|
||||
]
|
||||
.into_iter()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue