-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
48 lines (39 loc) · 1.11 KB
/
main.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 {
Client,
GatewayIntentBits,
Partials,
Collection,
} = require("discord.js");
const { Guilds, GuildMessages, MessageContent } = GatewayIntentBits;
const { User, Message, GuildMember, ThreadMember } = Partials;
const client = new Client({
intents: [Guilds, GuildMessages, MessageContent],
partials: [User, Message, GuildMember, ThreadMember],
});
client.config = require("./config.json");
const { loadEvents } = require("./Handlers/eventHandler");
client.events = new Collection();
client.commands = new Collection();
client.tejas404_api_key = process.env.tejas404_api_key;
client.openai_key = process.env.openai_key;
process.on("unhandledRejection", async (e) => {
console.log(e);
});
process.on("uncaughtException", async (e) => {
console.log(e);
});
loadEvents(client);
client.login(client.config.token);
const express = require("express");
const app = express();
const port = 3000;
app.get("/", (req, res) => {
res.send({
error: false,
message: "Bot Online!",
credits: "Made by Tejas Lamba#1924",
});
});
app.listen(port, () => {
console.log(`Chatopia listening on port ${port}`);
});