JaBa/commands/General/invite.js

53 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-01-04 02:18:28 +05:00
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
class Invite extends Command {
constructor(client) {
super(client, {
name: "invite",
dirname: __dirname,
enabled: false,
guildOnly: false,
aliases: ["i", "add", "vote"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const inviteLink = this.client.generateInvite({
scopes: ["bot"],
permissions: [Discord.Permissions.FLAGS.ADMINISTRATOR]
});
2022-01-04 02:18:28 +05:00
const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`;
const supportURL = await this.client.functions.supportLink(this.client);
if (args[0] && args[0] === "copy") return message.channel.send({
content: inviteLink
});
2022-01-04 02:18:28 +05:00
const embed = new Discord.MessageEmbed()
.setAuthor({
name: message.translate("general/invite:LINKS")
})
2022-01-04 02:18:28 +05:00
.setDescription(message.translate("general/invite:TIP", {
prefix: data.guild.prefix || ""
}))
.addField(message.translate("general/invite:ADD"), inviteLink)
.addField(message.translate("general/invite:VOTE"), voteURL)
.addField(message.translate("general/invite:SUPPORT"), supportURL)
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
2022-01-04 02:18:28 +05:00
message.channel.send({
embeds: [embed]
});
2022-01-04 02:18:28 +05:00
}
2022-01-13 00:26:23 +05:00
}
2022-01-04 02:18:28 +05:00
module.exports = Invite;