-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
35 lines (22 loc) · 878 Bytes
/
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
35
const Discord = require("discord.js");
const config = require("./config.json")
const client = new Discord.Client({ intents: ["Guilds", "GuildMembers", "MessageContent", "GuildMessages"] });
module.exports = client
client.on('interactionCreate', (interaction) => {
if (interaction.type === Discord.InteractionType.ApplicationCommand) {
const cmd = client.slashCommands.get(interaction.commandName);
if (!cmd) return interaction.reply(`Error`);
interaction["member"] = interaction.guild.members.cache.get(interaction.user.id);
cmd.run(client, interaction)
}
})
client.on("ready", () => {
console.log(`Estou online em ${client.user.username}`)
client.user.setActivity({
name: 'Lembrete',
type: Discord.ActivityType.Watching
})
})
client.slashCommands = new Discord.Collection()
require("./handler")(client)
client.login(config.token)