3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Use command aliases/overloads where applicable

This commit is contained in:
Dragory 2019-04-13 02:23:45 +03:00
parent ad10a79b6c
commit 503f1ff170
5 changed files with 18 additions and 13 deletions

View file

@ -68,8 +68,9 @@ export class RemindersPlugin extends ZeppelinPlugin<IRemindersPluginConfig> {
this.postRemindersTimeout = setTimeout(() => this.postDueRemindersLoop(), REMINDER_LOOP_TIME);
}
@d.command("remind", "<time:string> <reminder:string$>")
@d.command("remindme", "<time:string> <reminder:string$>")
@d.command("remind", "<time:string> <reminder:string$>", {
aliases: ["remindme"],
})
@d.permission("can_use")
async addReminderCmd(msg: Message, args: { time: string; reminder: string }) {
const now = moment();
@ -132,8 +133,9 @@ export class RemindersPlugin extends ZeppelinPlugin<IRemindersPluginConfig> {
createChunkedMessage(msg.channel, lines.join("\n"));
}
@d.command("reminders delete", "<num:number>")
@d.command("reminders d", "<num:number>")
@d.command("reminders delete", "<num:number>", {
aliases: ["reminders d"],
})
@d.permission("can_use")
async deleteReminderCmd(msg: Message, args: { num: number }) {
const reminders = await this.reminders.getRemindersByUserId(msg.author.id);

View file

@ -214,8 +214,9 @@ export class SelfGrantableRolesPlugin extends ZeppelinPlugin<ISelfGrantableRoles
lock.unlock();
}
@d.command("role help")
@d.command("role")
@d.command("role help", [], {
aliases: ["role"],
})
@d.cooldown(5000, "can_ignore_cooldown")
async roleHelpCmd(msg: Message) {
const channelGrantableRoles = await this.selfGrantableRoles.getForChannel(msg.channel.id);

View file

@ -223,8 +223,9 @@ export class SlowmodePlugin extends ZeppelinPlugin<ISlowmodePluginConfig> {
/**
* COMMAND: Set slowmode for the specified channel
*/
@d.command("slowmode", "<channel:channel> <time:string>")
@d.command("slowmode", "<time:string>")
@d.command("slowmode", "<channel:channel> <time:string>", {
overloads: ["<time:string>"],
})
@d.permission("can_manage")
async slowmodeCmd(msg: Message, args: { channel?: GuildChannel & TextChannel; time: string }) {
const channel = args.channel || msg.channel;

View file

@ -102,9 +102,9 @@ export class TagsPlugin extends ZeppelinPlugin<ITagsPluginConfig> {
this.savedMessages.events.off("delete", this.onMessageDeleteFn);
}
@d.command("tag list")
@d.command("tags")
@d.command("taglist")
@d.command("tag list", [], {
aliases: ["tags", "taglist"],
})
@d.permission("can_list")
async tagListCmd(msg: Message) {
const tags = await this.tags.all();

View file

@ -324,8 +324,9 @@ export class UtilityPlugin extends ZeppelinPlugin<IUtilityPluginConfig> {
});
}
@d.command("clean", "<count:number>")
@d.command("clean all", "<count:number>")
@d.command("clean", "<count:number>", {
aliases: ["clean all"],
})
@d.permission("can_clean")
async cleanAllCmd(msg: Message, args: { count: number }) {
if (args.count > MAX_CLEAN_COUNT || args.count <= 0) {