-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
53 lines (41 loc) · 1.5 KB
/
test.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
import switchConsoleDefault from '../utils/consoleToFile.js';
import { Client, gateWayIntents, message, Interaction } from '../structures/types.js';
import config from '../config.json' with { type: 'json' };
import { buttonTests } from './Buttontests.js';
import { createMenuTests } from './menuTests.js';
const { token } = config;
// switchConsoleDefault();
var c = new Client({
intents: [
gateWayIntents.Guilds,
gateWayIntents.GuildMessages,
gateWayIntents.GuildMessageReactions,
gateWayIntents.GuildVoiceStates,
gateWayIntents.GuildEmojisAndStickers,
gateWayIntents.GuildPresences,
gateWayIntents.GuildMembers,
gateWayIntents.DirectMessages,
gateWayIntents.DirectMessageReactions,
gateWayIntents.DirectMessageTyping,
gateWayIntents.MessageContent
]
});
c.login(token, true);
c.on('messageRecieved', /**@param {message} message*/ async (message) => {
if (message.content == 'buttontest') {
return buttonTests(message);
} else if (message.content == 'menutest') {
return createMenuTests(message);
}
(await import('./messageTests.js')).default(message);
});
c.on('interactionRecieved', /** @param {Interaction} interaction*/ async (interaction) => {
(await import('./interactionTests.js')).default(interaction);
});
c.on('guildCreate', async (guild) => {
(await import('./guildTests.js')).default(c);
});
c.on('ready', () => {
console.log("BOT ONLINE!");
console.log(c.commands);
});