Browse Source

add suggestion command

discord
Lio Young 5 months ago
parent
commit
b832a4c390
No known key found for this signature in database GPG Key ID: 789795A11879E169
  1. 30
      src/modules/general/suggestion.ts
  2. 10
      tsconfig.json

30
src/modules/general/suggestion.ts

@ -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)
}
}

10
tsconfig.json

@ -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"
]
}
Loading…
Cancel
Save