mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
tags: allow using --delete/-d with !tag to delete tags
This commit is contained in:
parent
42df230e71
commit
51bfb376cf
1 changed files with 14 additions and 2 deletions
|
@ -183,8 +183,20 @@ export class TagsPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
msg.channel.createMessage(successMessage(`Tag set! Use it with: \`${prefix}${args.tag}\``));
|
msg.channel.createMessage(successMessage(`Tag set! Use it with: \`${prefix}${args.tag}\``));
|
||||||
}
|
}
|
||||||
|
|
||||||
@d.command("tag", "<tag:string>")
|
@d.command("tag", "<tag:string>", {
|
||||||
async tagSourceCmd(msg: Message, args: { tag: string }) {
|
options: [
|
||||||
|
{
|
||||||
|
name: "delete",
|
||||||
|
shortcut: "d",
|
||||||
|
isSwitch: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
async tagSourceCmd(msg: Message, args: { tag: string; delete?: boolean }) {
|
||||||
|
if (args.delete) {
|
||||||
|
return this.deleteTagCmd(msg, { tag: args.tag });
|
||||||
|
}
|
||||||
|
|
||||||
const tag = await this.tags.find(args.tag);
|
const tag = await this.tags.find(args.tag);
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
msg.channel.createMessage(errorMessage("No tag with that name"));
|
msg.channel.createMessage(errorMessage("No tag with that name"));
|
||||||
|
|
Loading…
Add table
Reference in a new issue