Add more command aliases

This commit is contained in:
Ske 2019-07-10 13:55:48 +02:00
parent 352940abbd
commit 31173af87d
6 changed files with 46 additions and 17 deletions

View File

@ -6,22 +6,35 @@ namespace PluralKit.Bot.Commands
{ {
public class HelpCommands: ModuleBase<PKCommandContext> public class HelpCommands: ModuleBase<PKCommandContext>
{ {
[Command("help")] [Group("help")]
[Remarks("help")] public class HelpGroup: ModuleBase<PKCommandContext>
public async Task HelpRoot([Remainder] string _ignored)
{ {
await Context.Channel.SendMessageAsync(embed: new EmbedBuilder() [Command("proxy")]
.WithTitle("PluralKit") [Priority(1)]
.WithDescription("PluralKit is a bot designed for plural communities on Discord. It allows you to register systems, maintain system information, set up message proxying, log switches, and more.") [Remarks("help proxy")]
.AddField("What is this for? What are systems?", "This bot detects messages with certain tags associated with a profile, then replaces that message under a \"pseudo-account\" of that profile using webhooks. This is useful for multiple people sharing one body (aka \"systems\"), people who wish to roleplay as different characters without having several accounts, or anyone else who may want to post messages as a different person from the same account.") public async Task HelpProxy()
.AddField("Why are people's names saying [BOT] next to them?", "These people are not actually bots, this is just a Discord limitation. See [the documentation](https://pluralkit.me/guide#proxying) for an in-depth explanation.") {
.AddField("How do I get started?", "To get started using PluralKit, try running the following commands (of course replacing the relevant names with your own):\n**1**. `pk;system new` - Create a system (if you haven't already)\n**2**. `pk;member add John` - Add a new member to your system\n**3**. `pk;member John proxy [text]` - Set up [square brackets] as proxy tags\n**4**. You're done! You can now type [a message in brackets] and it'll be proxied appropriately.\n**5**. Optionally, you may set an avatar from the URL of an image with `pk;member John avatar [link to image]`, or from a file by typing `pk;member John avatar` and sending the message with an attached image.\n\nSee [the documentation](https://pluralkit.me/guide#member-management) for more information.") await Context.Channel.SendMessageAsync(
.AddField("Useful tips", $"React with {Emojis.Error} on a proxied message to delete it (only if you sent it!)\nReact with {Emojis.RedQuestion} on a proxied message to look up information about it (like who sent it)\nType **`pk;invite`** to get a link to invite this bot to your own server!") "The proxy help page has been moved! See the website: https://pluralkit.me/guide#proxying");
.AddField("More information", "For a full list of commands, see [the command list](https://pluralkit.me/commands).\nFor a more in-depth explanation of message proxying, see [the documentation](https://pluralkit.me/guide#proxying).\nIf you're an existing user of Tupperbox, type `pk;import` and attach a Tupperbox export file (from `tul!export`) to import your data from there.") }
.AddField("Support server", "We also have a Discord server for support, discussion, suggestions, announcements, etc: https://discord.gg/PczBt78")
.WithFooter("By @Ske#6201 | GitHub: https://github.com/xSke/PluralKit/ | Website: https://pluralkit.me/") [Command]
.WithColor(Color.Blue) [Remarks("help")]
.Build()); public async Task HelpRoot([Remainder] string _ignored = null)
{
await Context.Channel.SendMessageAsync(embed: new EmbedBuilder()
.WithTitle("PluralKit")
.WithDescription("PluralKit is a bot designed for plural communities on Discord. It allows you to register systems, maintain system information, set up message proxying, log switches, and more.")
.AddField("What is this for? What are systems?", "This bot detects messages with certain tags associated with a profile, then replaces that message under a \"pseudo-account\" of that profile using webhooks. This is useful for multiple people sharing one body (aka \"systems\"), people who wish to roleplay as different characters without having several accounts, or anyone else who may want to post messages as a different person from the same account.")
.AddField("Why are people's names saying [BOT] next to them?", "These people are not actually bots, this is just a Discord limitation. See [the documentation](https://pluralkit.me/guide#proxying) for an in-depth explanation.")
.AddField("How do I get started?", "To get started using PluralKit, try running the following commands (of course replacing the relevant names with your own):\n**1**. `pk;system new` - Create a system (if you haven't already)\n**2**. `pk;member add John` - Add a new member to your system\n**3**. `pk;member John proxy [text]` - Set up [square brackets] as proxy tags\n**4**. You're done! You can now type [a message in brackets] and it'll be proxied appropriately.\n**5**. Optionally, you may set an avatar from the URL of an image with `pk;member John avatar [link to image]`, or from a file by typing `pk;member John avatar` and sending the message with an attached image.\n\nSee [the documentation](https://pluralkit.me/guide#member-management) for more information.")
.AddField("Useful tips", $"React with {Emojis.Error} on a proxied message to delete it (only if you sent it!)\nReact with {Emojis.RedQuestion} on a proxied message to look up information about it (like who sent it)\nType **`pk;invite`** to get a link to invite this bot to your own server!")
.AddField("More information", "For a full list of commands, see [the command list](https://pluralkit.me/commands).\nFor a more in-depth explanation of message proxying, see [the documentation](https://pluralkit.me/guide#proxying).\nIf you're an existing user of Tupperbox, type `pk;import` and attach a Tupperbox export file (from `tul!export`) to import your data from there.")
.AddField("Support server", "We also have a Discord server for support, discussion, suggestions, announcements, etc: https://discord.gg/PczBt78")
.WithFooter("By @Ske#6201 | GitHub: https://github.com/xSke/PluralKit/ | Website: https://pluralkit.me/")
.WithColor(Color.Blue)
.Build());
}
} }
[Command("commands")] [Command("commands")]

View File

@ -23,6 +23,7 @@ namespace PluralKit.Bot.Commands
public override string ContextNoun => "member"; public override string ContextNoun => "member";
[Command("new")] [Command("new")]
[Alias("n", "add", "create", "register")]
[Remarks("member new <name>")] [Remarks("member new <name>")]
[MustHaveSystem] [MustHaveSystem]
public async Task NewMember([Remainder] string memberName) { public async Task NewMember([Remainder] string memberName) {
@ -82,7 +83,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("description")] [Command("description")]
[Alias("info", "bio", "text")] [Alias("info", "bio", "text", "desc")]
[Remarks("member <member> description <description>")] [Remarks("member <member> description <description>")]
[MustPassOwnMember] [MustPassOwnMember]
public async Task MemberDescription([Remainder] string description = null) { public async Task MemberDescription([Remainder] string description = null) {
@ -174,7 +175,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("delete")] [Command("delete")]
[Alias("remove", "erase", "yeet")] [Alias("remove", "destroy", "erase", "yeet")]
[Remarks("member <member> delete")] [Remarks("member <member> delete")]
[MustPassOwnMember] [MustPassOwnMember]
public async Task MemberDelete() public async Task MemberDelete()

View File

@ -7,6 +7,7 @@ namespace PluralKit.Bot.Commands {
public BotConfig BotConfig { get; set; } public BotConfig BotConfig { get; set; }
[Command("invite")] [Command("invite")]
[Alias("inv")]
[Remarks("invite")] [Remarks("invite")]
public async Task Invite() public async Task Invite()
{ {

View File

@ -27,6 +27,7 @@ namespace PluralKit.Bot.Commands
[Command("message")] [Command("message")]
[Remarks("message <messageid>")] [Remarks("message <messageid>")]
[Alias("msg")]
public async Task GetMessage(ulong messageId) public async Task GetMessage(ulong messageId)
{ {
var message = await Messages.Get(messageId); var message = await Messages.Get(messageId);
@ -37,6 +38,7 @@ namespace PluralKit.Bot.Commands
[Command("message")] [Command("message")]
[Remarks("message <messageid>")] [Remarks("message <messageid>")]
[Alias("msg")]
public async Task GetMessage(IMessage msg) => await GetMessage(msg.Id); public async Task GetMessage(IMessage msg) => await GetMessage(msg.Id);
} }
} }

View File

@ -22,6 +22,7 @@ namespace PluralKit.Bot.Commands
public async Task Switch(params PKMember[] members) => await DoSwitchCommand(members); public async Task Switch(params PKMember[] members) => await DoSwitchCommand(members);
[Command("out")] [Command("out")]
[Alias("none")]
[Remarks("switch out")] [Remarks("switch out")]
[MustHaveSystem] [MustHaveSystem]
public async Task SwitchOut() => await DoSwitchCommand(new PKMember[] { }); public async Task SwitchOut() => await DoSwitchCommand(new PKMember[] { });
@ -56,6 +57,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("move")] [Command("move")]
[Alias("shift")]
[Remarks("switch move <date/time>")] [Remarks("switch move <date/time>")]
[MustHaveSystem] [MustHaveSystem]
public async Task SwitchMove([Remainder] string str) public async Task SwitchMove([Remainder] string str)
@ -101,6 +103,7 @@ namespace PluralKit.Bot.Commands
[Command("delete")] [Command("delete")]
[Remarks("switch delete")] [Remarks("switch delete")]
[Alias("remove", "erase", "cancel", "yeet")]
[MustHaveSystem] [MustHaveSystem]
public async Task SwitchDelete() public async Task SwitchDelete()
{ {

View File

@ -37,6 +37,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("new")] [Command("new")]
[Alias("register", "create", "init", "add", "make")]
[Remarks("system new <name>")] [Remarks("system new <name>")]
public async Task New([Remainder] string systemName = null) public async Task New([Remainder] string systemName = null)
{ {
@ -49,6 +50,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("name")] [Command("name")]
[Alias("rename", "changename")]
[Remarks("system name <name>")] [Remarks("system name <name>")]
[MustHaveSystem] [MustHaveSystem]
public async Task Name([Remainder] string newSystemName = null) { public async Task Name([Remainder] string newSystemName = null) {
@ -60,6 +62,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("description")] [Command("description")]
[Alias("desc")]
[Remarks("system description <description>")] [Remarks("system description <description>")]
[MustHaveSystem] [MustHaveSystem]
public async Task Description([Remainder] string newDescription = null) { public async Task Description([Remainder] string newDescription = null) {
@ -96,6 +99,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("delete")] [Command("delete")]
[Alias("remove", "destroy", "erase", "yeet")]
[Remarks("system delete")] [Remarks("system delete")]
[MustHaveSystem] [MustHaveSystem]
public async Task Delete() { public async Task Delete() {
@ -108,6 +112,7 @@ namespace PluralKit.Bot.Commands
} }
[Group("list")] [Group("list")]
[Alias("l", "members")]
public class SystemListCommands: ModuleBase<PKCommandContext> { public class SystemListCommands: ModuleBase<PKCommandContext> {
public MemberStore Members { get; set; } public MemberStore Members { get; set; }
@ -158,6 +163,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("fronter")] [Command("fronter")]
[Alias("f", "front", "fronters")]
[Remarks("system [system] fronter")] [Remarks("system [system] fronter")]
public async Task SystemFronter() public async Task SystemFronter()
{ {
@ -171,6 +177,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("fronthistory")] [Command("fronthistory")]
[Alias("fh", "history", "switches")]
[Remarks("system [system] fronthistory")] [Remarks("system [system] fronthistory")]
public async Task SystemFrontHistory() public async Task SystemFrontHistory()
{ {
@ -184,6 +191,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("frontpercent")] [Command("frontpercent")]
[Alias("frontbreakdown", "frontpercent", "front%", "fp")]
[Remarks("system [system] frontpercent [duration]")] [Remarks("system [system] frontpercent [duration]")]
public async Task SystemFrontPercent(string durationStr = "30d") public async Task SystemFrontPercent(string durationStr = "30d")
{ {
@ -201,6 +209,7 @@ namespace PluralKit.Bot.Commands
} }
[Command("timezone")] [Command("timezone")]
[Alias("tz")]
[Remarks("system timezone [timezone]")] [Remarks("system timezone [timezone]")]
[MustHaveSystem] [MustHaveSystem]
public async Task SystemTimezone([Remainder] string zoneStr = null) public async Task SystemTimezone([Remainder] string zoneStr = null)