-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
42 lines (33 loc) · 1.78 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
41
42
const { Client, Collection, GatewayIntentBits, Partials, ActivityType } = require("discord.js");
const colors = require("colors");
const client = new Client({
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildModeration, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildWebhooks, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.DirectMessageTyping, GatewayIntentBits.GuildScheduledEvents, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent ],
partials: [ Partials.Channel, Partials.GuildMember, Partials.GuildScheduledEvent, Partials.Message, Partials.Reaction, Partials.ThreadMember, Partials.User ],
restTimeOffset: 0,
failIfNotExists: false,
presence: {
activities: [{
name: `Chose your status`,
type: ActivityType.Streaming,
url: "https://www.twitch.tv/zqx"
}],
status: "online"
},
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false
}
});
const config = require('./settings/config');
client.login(config.token);
module.exports = client;
client.slashCommands = new Collection();
client.on("ready", async () => {
require('./handler')(client);
const readyEvent = require('./events/client/ready');
await readyEvent.execute(client);
});
process.on("unhandledRejection", (error) => {
if (error.code == 10062) return; // Unknown interaction
console.log(`[ERROR] ${error}`.red);
})