@voidpkg/discord-multiple-clients
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Discord Multiple Clients

npm version Build Status codecov dependencies install size

Image

showcase


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: "..." });

Readme

Keywords

none

Package Sidebar

Install

npm i @voidpkg/discord-multiple-clients

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

5.24 kB

Total Files

4

Last publish

Collaborators

  • clqu