JaBa/commands/General/invite.js

57 lines
1.6 KiB
JavaScript
Raw Normal View History

const Command = require("../../base/Command"),
2022-01-04 02:18:28 +05:00
Discord = require("discord.js");
class Invite extends Command {
constructor(client) {
super(client, {
name: "invite",
dirname: __dirname,
enabled: true,
2022-01-04 02:18:28 +05:00
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]
});
const donateLink = "https://qiwi.com/n/JONNYBRO/";
// const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`;
2022-01-04 02:18:28 +05:00
if (args[0] && args[0] === "copy") return message.reply({
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 || ""
}))
2022-02-05 22:05:10 +05:00
.addField(message.translate("general/invite:ADD"), message.translate("general/invite:CLICK", {
link: inviteLink
}))
.addField(message.translate("general/invite:SUPPORT"), message.translate("general/invite:CLICK", {
link: donateLink
}) + `\n*для других способов пишите в ЛС <@${data.config.owner.id}>*`)
// .addField(message.translate("general/invite:VOTE"), voteURL)
2022-01-04 02:18:28 +05:00
.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;