JaBa/commands/General/invite.js

42 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
class Invite extends Command {
2021-12-26 19:29:37 +05:00
constructor(client) {
2021-12-10 21:39:54 +05:00
super(client, {
name: "invite",
dirname: __dirname,
2021-12-11 01:11:50 +05:00
enabled: false,
2021-12-10 21:39:54 +05:00
guildOnly: false,
2021-12-26 19:29:37 +05:00
aliases: ["i", "add", "vote"],
2021-12-10 21:39:54 +05:00
memberPermissions: [],
2021-12-26 19:29:37 +05:00
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
2021-12-10 21:39:54 +05:00
nsfw: false,
ownerOnly: false,
cooldown: 1000
2021-12-10 21:39:54 +05:00
});
}
2021-12-26 19:29:37 +05:00
async run(message, args, data) {
const inviteLink = `https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=8`;
const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`;
const supportURL = await this.client.functions.supportLink(this.client);
2021-12-10 21:39:54 +05:00
if (args[0] && args[0] === "copy") return message.channel.send(inviteLink);
const embed = new Discord.MessageEmbed()
.setAuthor(message.translate("general/invite:LINKS"))
2021-12-26 19:29:37 +05:00
.setDescription(message.translate("general/invite:TIP", {
prefix: data.guild.prefix || ""
}))
2021-12-10 21:39:54 +05:00
.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(data.config.embed.footer);
message.channel.send(embed);
}
};
module.exports = Invite;