-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (36 loc) · 1.03 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
35
36
37
38
39
40
require("dotenv").config();
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v10");
const { Client, GatewayIntentBits } = require("discord.js");
const commands = require("./commands");
require('colors');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.DirectMessages,
],
});
client.on("ready", async () => {
console.clear();
console.log(`Bot ${client.user.tag} is now online`.green);
const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);
(async () => {
try {
await rest.put(
Routes.applicationGuildCommands(
process.env.ClientID,
process.env.GuildID
),
{ body: commands }
);
console.log(`Registered Guild Commands.`.green);
} catch (error) {
console.error(error);
}
})();
require("./ticket")(client);
});
client.login(process.env.TOKEN);