-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (20 loc) · 820 Bytes
/
index.js
File metadata and controls
26 lines (20 loc) · 820 Bytes
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
const {Client, GatewayIntentBits, Partials, Collection} = require('discord.js');
const {Guilds, GuildMembers, GuildMessages, MessageContent} = GatewayIntentBits;
const {User, Message, GuildMember, ThreadMember, Channel} = Partials;
const { OpenAI } = require('openai');
require('dotenv').config();
const client = new Client({
intents: [Guilds, GuildMessages, GuildMembers, MessageContent],
partials: [User, Message, GuildMember, ThreadMember, Channel]
});
const {loadEvents} = require('./Handlers/eventHandler');
const {loadCommands} = require('./Handlers/commandHandler');
client.commands = new Collection();
client.login(process.env.DISCORD_TOKEN).then(() => {
loadEvents(client);
loadCommands(client);
});
const openai = new OpenAI({
apiKey: process.env.OPENAI_KEY,
})
client.openai = openai