thaldrin/src/discord/commands/info/about.ts

51 lines
2.3 KiB
TypeScript
Raw Normal View History

2021-09-11 11:36:51 +00:00
import { Context } from '../../../utils/types';
import { Command } from '@thaldrin/eu';
2021-04-10 01:52:59 +00:00
import { MessageEmbed } from 'discord.js';
2021-09-11 11:36:51 +00:00
import config from '../../../../config';
2021-04-04 15:17:46 +00:00
export = class Info extends Command {
constructor() {
super({
2021-05-07 23:57:48 +00:00
name: "about",
2021-04-04 15:17:46 +00:00
description: "Show Information about the Bot",
2021-04-10 01:52:59 +00:00
cooldown: 0
2021-04-04 15:17:46 +00:00
})
}
2021-04-08 22:42:39 +00:00
async command(ctx: Context) {
2021-04-10 01:52:59 +00:00
let devs: string[] | string = []
let contribs: string[] | string = []
if (ctx.config.variables.developers.length > 1) {
ctx.config.variables.developers.forEach(dev => {
// @ts-ignore
return devs.push(`\n**- [${ctx.client.users.cache.get(dev.id)?.username}](${dev.link})**`)
})
devs = devs.join(' ')
} else {
2021-09-11 11:36:51 +00:00
// @ts-ignore
2021-04-10 01:52:59 +00:00
devs = `**[${ctx.client.users.cache.get(ctx.config.variables.developers[0].id)?.username}](${ctx.config.variables.developers[0].link})**`
}
if (ctx.config.variables.contributors.length > 1) {
ctx.config.variables.contributors.forEach(contributor => {
// @ts-ignore
return contribs.push(`\n**- [${contributor.nick}](${contributor.link})** - ${contributor.reason}`)
})
contribs = contribs.join(' ')
} else {
contribs = `**[${ctx.config.variables.contributors[0].nick}](${ctx.config.variables.contributors[0].link})** - ${ctx.config.variables.contributors[0].reason}`
}
let InfoEmbed = new MessageEmbed()
.setDescription(`
2021-05-13 12:43:49 +00:00
Made by ${devs}\n
A [Caecus](https://werewolf.design) Project\n[Consider supporting the Development of this Bot](https://lio.cat/support)`)
2021-04-10 01:52:59 +00:00
.addField("Contributors", `${contribs}`, false)
.addField("Source", config.variables.source, true)
2021-09-11 11:36:51 +00:00
// @ts-ignore
2021-04-10 01:52:59 +00:00
.addField("Support Server", `[${ctx.client.guilds.cache.get(ctx.config.variables.support.id)?.name}](${ctx.config.variables.support.invite})`, true)
.addField("Website", `[${ctx.config.variables.website}](https://${ctx.config.variables.website})`, true)
.setColor(ctx.config.variables.color)
.setFooter(`${config.variables.name}, ${config.variables.tagline}`, config.variables.avatar)
ctx.channel.send(InfoEmbed)
2021-04-04 15:17:46 +00:00
}
}