-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (26 loc) · 1.21 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const fs = require('fs')
const { Client, Intents, Collection, Permissions, MessageEmbed, MessageActionRow, MessageButton } = require("discord.js");
const client = new Client({ intents: 32269, partials: ['CHANNEL'] });
require('dotenv').config()
client.aliases = new Collection();
client.interactions = new Collection();
fs.readdir("./events/", (err, files) => {
const eventHandler = require("./handler/eventHandler");
eventHandler(err, files, client);
});
client.on('interactionCreate', async interaction => {
if (!interaction.isButton()) return;
if (interaction.customId === 'inviteBtn') {
try {
const inviteRow = new MessageActionRow()
inviteRow.addComponents(
new MessageButton()
.setLabel('Click here to invite me to your server!')
.setStyle('LINK')
.setURL("https://discord.com/api/oauth2/authorize?client_id=985254683792797736&permissions=1&scope=applications.commands%20bot")
)
interaction.reply({content:"**Go to my profile and press <:add1:985489841582129194><:add2:985490952867176459><:add3:985489868010438696> or press on the button below!**",components:[inviteRow],ephemeral:true})
} catch (e) { }
}
});
client.login(process.env.DISCORD_TOKEN)