This repository was archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
56 lines (45 loc) · 1.43 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const { Client, GatewayIntentBits, Partials, Collection } = require("discord.js");
const { AoiClient, LoadCommands } = require('aoi.js');
const { Guilds, GuildMembers, GuildMessages } = GatewayIntentBits;
const { User, Message, GuildMember, ThreadMember } = Partials;
const { loadEvents } = require("./Handlers/eventHandler");
const { loadCommands } = require("./Handlers/commandHandler");
const { token } = require("./config.json");
const client = new Client({
intents: [Guilds, GuildMembers, GuildMessages],
partials: [User, Message, GuildMember, ThreadMember],
});
const bot = new AoiClient({
token: token,
prefix: "-",
intents: ["MessageContent", "Guilds", "GuildMessages"],
events: ["onMessage", "onInteractionCreate"],
mobilePlatform: false,
database: {
type: "aoi.db",
db: require("aoi.db"),
tables: ["main"],
path: "./databaseAoi/",
extraOptions: {
dbType: "KeyValue"
}
}
});
bot.variables({
teste: '',
teste2: '',
numteste: 0,
});
const loader = new LoadCommands(bot);
loader.load(bot.cmd, "./AoiCommands/");
client.commands = new Collection();
process.on('uncaughtException', (error) => {
console.error('uncaughtExceptionError' + error)
});
process.on('unhandledRejection', (error) => {
console.error('unhandledRejectionError' + error)
});
client.login(token).then(() => {
loadEvents(client);
loadCommands(client);
});