-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
48 lines (39 loc) · 1.97 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
const { AoiClient } = require("aoi.js"); // Define aoi.js client
const config = require("./config.json"); // Load the setup options from config
require('dotenv').config() // Enable env support in local hosting
// Needed for handler codes
const functions = require("./handlers/functions.js");
const vars = require('./handlers/variables.js');
// Setting up Client
const client = new AoiClient({
token: process.env.BotToken || config.BotToken, // Token with either env or config
prefix: "$getGuildVar[prefix]", // By default, it uses custom prefix system (default prefix used: d!).
intents: ["MessageContent", "Guilds", "GuildMessages", "GuildMembers", "GuildPresences", "GuildModeration", "GuildEmojisAndStickers"], // Discord.js intents (v14)
events: ["onMessage", "onInteractionCreate", "onJoin", "onLeave", "onMessageDelete", "onMessageUpdate", "onBanAdd", "onBanRemove", "onGuildJoin", "onFunctionError"], // Setup aoi.js events
aoiLogs: false, // Don't show aoi.js default console message
aoiWarning: false, // Disable aoi.js update warning
database: { // Use aoi.db as the default database for storing data
type: "aoi.db",
db: require("@aoijs/aoi.db"),
dbType: "KeyValue",
tables: ["main"], // tables for the database
securityKey: process.env.DBsecurityKey || config.DBsecurityKey // Security Key with either env or config
},
disableFunctions: ["$clientToken"], // For safety reasons
mobilePlatform: config.MobileStatus, // Whether or not to enable mobile status
debugs: {
interpreter: config.EnableDebugMode // Whether or not to enable aoi.js debug mode
},
respondOnEdit: {
commands: config.respondOnEdit,
time: 20000
},
aoiAutoUpdate: false,
suppressAllErrors: config.DisableAllErrors // Whether or not to disable errors from aoi.js
});
// Handlers
client.loadCommands("./commands/", config.LogCommands);
Object.keys(vars).forEach((t) =>
client.variables(vars[t], t)
)
functions.forEach((func) => client.functionManager.createFunction(func));