-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
52 lines (44 loc) · 1.46 KB
/
main.js
File metadata and controls
52 lines (44 loc) · 1.46 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
const {
Client,
Partials,
Events,
GatewayIntentBits,
} = require('discord.js');
const dotenv = require('dotenv');
dotenv.config();
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
],
partials: [
Partials.Message,
Partials.Channel,
Partials.Reaction,
],
});
const DebugManager = require('./beta_modules/DebugManager')
const dbg_mnger = new DebugManager(false); // プッシュ時は必ずfalseにする。
//-------------------<|commands|>-----------------------//
const CommandManager = require("./command_manager");
const cmd_mnger = new CommandManager();
cmd_mnger.read_from_dir("./commands", "./guild_info");
//--------------------<|events|>------------------------//
require("./event_manager2").set(client, "./events", dbg_mnger);
client.once(Events.ClientReady, async (c) => {
await cmd_mnger.set(client);
console.log("setted Commands.");
console.log(`Ready! (${c.user.tag})`);
client.user.setPresence({
activities: [],
status: 'online'
});
});
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isCommand()) return;
await cmd_mnger.execute(client, interaction, dbg_mnger);
});
client.login(process.env.TOKEN);