mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
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);
|
|
}); |