This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
68 lines (62 loc) · 1.72 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
57
58
59
60
61
62
63
64
65
66
67
68
const discord = require("discord.js");
require("dotenv").config();
const { QuickDB } = require("quick.db");
const schedule = require("node-schedule");
const client = new discord.Client({
intents: 3276799,
cacheWithLimits: {
MessageManager: {
sweepInterval: 300,
sweepFilter: discord.Sweepers.filterByLifetime({
lifetime: 60,
getComparisonTimestamp: (m) => m.editedTimestamp ?? m.createdTimestamp,
}),
},
},
});
client.cor = "#780803";
client.db = new QuickDB();
client.dbm = require("./database");
client.canais = {
logs: "1025780160437432330",
errors: "1047219954015031386",
};
client.msg = {
embeds: {
nopermmod: new discord.EmbedBuilder()
.setAuthor({
name: `» Para usar este comando você deverá ser da equipe de moderação.`,
iconURL: client.err,
})
.setColor(client.cor),
},
};
process.on("unhandledRejection", (error) => {
console.log(error);
client.channels.cache
.get(client.canais.errors)
.send("Erro detectado: \n" + error);
});
process.on("uncaughtException", (error) => {
console.log(error);
client.channels.cache
.get(client.canais.errors)
.send("Erro detectado: \n" + error);
});
schedule.scheduleJob("0 3 * * */1", async function () {
const results = await client.db.all();
await client.channels.cache.get("1068214966286565437").send({
content:
"Resultados das parcerias de hoje: \n" +
results
.map(function (callback) {
return `<@${callback.id}> - ${callback.value.parcerias}`;
})
.join("\n"),
});
await client.db.deleteAll();
});
const boilerplateComponents = async () => {
await require("./src/util/boilerplateClient")(client);
};
boilerplateComponents();