@voidpkg/discord-multiple-clients
v1.0.1
Published
[![npm version](https://badge.fury.io/js/@voidpkg/discord-multiple-clients.svg)](https://badge.fury.io/js/@voidpkg/discord-multiple-clients) [![Build Status](https://img.shields.io/github/checks-status/VoidDevsOrg/discord-multiple-clients/master)](https:
Downloads
2
Readme
Discord Multiple Clients
Image
Usage
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: "..." });