add suggestion command

This commit is contained in:
Lio Young 2021-04-24 17:42:07 +02:00
parent 600a561ce0
commit b832a4c390
No known key found for this signature in database
GPG Key ID: 789795A11879E169
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,30 @@
import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import SendWS from "../../utils/webhook";
import lingua from '../../utils/lingua';
import { suggest } from '../../utils/trello';
export = class Fox extends Command {
constructor() {
super({
name: "suggest",
description: "Suggest a Feature!",
aliases: ["suggestion"],
cooldown: 10,
})
}
async command(ctx: Context) {
const [title, desc] = ctx.args.join(" ").split("|").map(v => v.trim());
// @ts-ignore
if (!title) return ctx.channel.send(lingua[ctx.settings.locale].MISSING_TITLE)
let author = `${ctx.author.tag} (${ctx.author.id})`
let guild = `${ctx.guild?.name} (${ctx.guild?.id})`
await suggest({ title, desc, author, guild })
if (ctx.config?.webhook?.suggestions) await SendWS(ctx.config.webhook.suggestions, { title, desc, ctx })
// @ts-ignore
ctx.channel.send(lingua[ctx.settings.locale].SUGGESTION_SENT)
}
}

View File

@ -22,5 +22,13 @@
"declaration": true
},
"include": ["**/*"],
"exclude": ["node_modules", "build", "out", "tmp", "logs", "test"]
"exclude": [
"node_modules",
"build",
"out",
"tmp",
"logs",
"test",
"sample.config.ts"
]
}