import { MultipleClient } from '@voidpkg/discord-multiple-clients';
import { Client, GatewayIntentBits } from 'discord.js';
const multipleClient = new MultipleClient(Client, {
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]
});
multipleClient.on("ready", (client) => {
console.log(`Connected as a ${client.user.username} with ${client.multipleId}`);
});
multipleClient.on("messageCreate", (client, message) => {
const otherClient = multipleClient.getClient(2);
if (client.multipleId !== 2 && otherClient) {
otherClient.channels.cache.get("922959060297457726")?.send([
"```json",
JSON.stringify({
from: client.multipleId,
message: message.content
}),
"```"
].join('\n'));
}
})
multipleClient.login([
{ id: 1, token: "..." },
{ id: 2, token: "..." }
]);
multipleClient.login({ id: 3, token: "..." });