-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopic.js
76 lines (66 loc) · 2.17 KB
/
topic.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
69
70
71
72
73
74
75
76
require("dotenv").config();
const express = require("express");
const { Client, Collection, GatewayIntentBits } = require("discord.js");
const mongoose = require("mongoose");
const client = new Client({
fetchAllMembers: true,
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false,
},
partials: ["MESSAGE", "CHANNEL", "REACTION"],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildScheduledEvents,
],
});
client.commands = new Collection();
client.slash = new Collection();
client.aliases = new Collection();
client.cooldowns = new Collection();
client.config = require("./config/config.js");
client.logger = require("./functions/logger");
client.errors = require("./functions/errors");
let date = new Date();
client.footer = `\u00a9 ${date.getFullYear()} • TopicBotList`;
client.logo = `https://cdn.topiclist.xyz/images/gif/Topic.gif`;
client.banner = `https://cdn.topiclist.xyz/images/jpg/banner.png`;
client.color = `#0000FF`;
const eventHandler = require("./functions/handlers");
eventHandler.loadEvents(client);
eventHandler.loadSlash(client);
(async () => {
try {
mongoose.set("strictQuery", false);
await mongoose.connect(process.env.MONGODB_URI, { keepAlive: true });
console.log("Connected to DB.");
eventHandler(client);
} catch (error) {
console.log(`Error: ${error}`);
}
})();
client.login(process.env.devtoken);
//client.login(process.env.DISCORD_TOKEN);
//temp use only xD
const app = express();
const port = 3000;
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.listen(port, () => {
console.log(`app listening on port ${port}`);
});