-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
103 lines (94 loc) · 2.42 KB
/
index.js
File metadata and controls
103 lines (94 loc) · 2.42 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
const { AoiClient, LoadCommands, CustomEvent } = require('aoi.js');
const { Database } = require('aoi.mongo');
const fs = require('node:fs');
const customFunctions = fs.readdirSync('./handler/functions');
const { Webhook } = require('@top-gg/sdk');
const app = require('express')();
require('dotenv').config();
//Client Setup
const arox = new AoiClient({
token: process.env.BOT_TOKEN,
prefix: ["a!", "$getGuildVar[prefix;$guildID;main]"],
intents: [
'MessageContent',
'Guilds',
'GuildMembers',
'GuildMessages',
'GuildVoiceStates',
'GuildIntegrations',
'GuildWebhooks',
'GuildInvites',
],
events: [
'onGuildJoin',
'onGuildLeave',
'onMessage',
'onInteractionCreate',
'onVariableCreate',
'onVariableDelete',
'onVariableUpdate',
'onFunctionError',
],
disableAoiDB: true,
disableFunctions: ['$clientToken'],
suppressAllErrors: true,
errorMessage: '**⚠️ | $userDisplayName[$authorid]**, $language[tr:Bilinmeyen bir hata oluştu! Lütfen destek sunucumuza katılıp bildirin!;en:An unknown error occurred! Please join our support server and report!]',
});
//Database Setup
const database = new Database(arox, {
url: process.env.MONGODB_URL,
tables: ['main', 'important'],
logging: true
});
//Command Loader
arox.loadCommands('./commands/', true);
//Variable Loader
require('./handler/variables/main.js')(arox);
require('./handler/variables/important.js')(arox);
//Custom Function Loader
customFunctions.forEach((file) => {
require(`./handler/functions/${file}`)(arox);
});
//Top.gg Trigger
const webhook = new Webhook(process.env.TOPGG_TOKEN);
const event = new CustomEvent(arox);
event.command({
listen: 'vote',
code: `
$awaitExecute[topggVoteMsg]
$awaitExecute[topggVote]
$let[authorID;$djsEval[d.data.eventData[0].user;true]]
`,
});
event.listen('vote');
app.post('/vote',
webhook.listener((vote) => {
event.emit('vote', vote);
}),
);
app.listen(process.env.PORT || 3000, () => {
console.log(`I'm now running on port ${process.env.PORT || 3000}.`);
});
//Bot Status
arox.status(
{
name: 'a!help | Reach the available commands!',
time: 5,
type: 'CUSTOM',
},
{
name: 'a!stockmarket | Dive into the stock market!',
time: 3,
type: 'CUSTOM',
},
{
name: 'a!professions | Work in professions!',
time: 3,
type: 'CUSTOM',
},
{
name: 'a!shop | Shop in the virtual market!',
time: 3,
type: 'CUSTOM',
},
);