implement misc commands

This commit is contained in:
dusk 2025-10-07 14:47:35 +00:00
parent 1627e25268
commit f14901a4e3
No known key found for this signature in database
2 changed files with 8 additions and 3 deletions

View file

@ -15,6 +15,8 @@ public partial class CommandTree
"For the list of commands, see the website: <https://pluralkit.me/commands>"),
Commands.HelpProxy => ctx.Reply(
"The proxy help page has been moved! See the website: https://pluralkit.me/guide#proxying"),
Commands.Invite => ctx.Execute<Misc>(Invite, m => m.Invite(ctx)),
Commands.Stats => ctx.Execute<Misc>(null, m => m.Stats(ctx)),
Commands.MemberShow(var param, var flags) => ctx.Execute<Member>(MemberInfo, m => m.ViewMember(ctx, param.target, flags.show_embed)),
Commands.MemberNew(var param, _) => ctx.Execute<Member>(MemberNew, m => m.NewMember(ctx, param.name)),
Commands.MemberSoulscream(var param, _) => ctx.Execute<Member>(MemberInfo, m => m.Soulscream(ctx, param.target)),
@ -331,8 +333,6 @@ public partial class CommandTree
// Legacy command routing - these are kept for backwards compatibility until fully migrated to new system
if (ctx.Match("commands", "cmd", "c"))
return CommandHelpRoot(ctx);
if (ctx.Match("invite")) return ctx.Execute<Misc>(Invite, m => m.Invite(ctx));
if (ctx.Match("stats", "status")) return ctx.Execute<Misc>(null, m => m.Stats(ctx));
}
private async Task CommandHelpRoot(Context ctx)

View file

@ -1,5 +1,10 @@
use super::*;
pub fn cmds() -> impl Iterator<Item = Command> {
[].into_iter()
[
command!("invite" => "invite").help("Gets a link to invite PluralKit to other servers"),
command!(("stats", ["status"]) => "stats")
.help("Shows statistics and information about PluralKit"),
]
.into_iter()
}