Top-gg-Community / node-sdk

An official module for interacting with the Top.gg API
https://topgg.js.org/
132 stars 42 forks source link

chore: keep d.js client initialization up to date #76

Closed Idris1401 closed 1 year ago

netlify[bot] commented 1 year ago

Deploy Preview for topgg-node-sdk-docs ready!

Name Link
Latest commit b1d55d5e6fcdc7533a6aed7fa5d9444d092901db
Latest deploy log https://app.netlify.com/sites/topgg-node-sdk-docs/deploys/641d7e662fbb2e00088e1df1
Deploy Preview https://deploy-preview-76--topgg-node-sdk-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

jpbberry commented 1 year ago

topgg-autoposter is purposefully library agnostic. I don't think this is a good idea as the client initialization is different across discord.js and eris for example.

const Eris = require("eris");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN", {
    intents: [
        "guildMessages"
    ]
});

vs

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

In a perfect world I'd not even include the initialization, I just want to make sure that the client variable is obvious.

Idris1401 commented 1 year ago

then the client initialization should be fully removed imo (also the current example is for discord.js. so if you wanna keep it, it needs to be updated)

jpbberry commented 1 year ago

The point of it is to give an example of a client initialization, it isn't discord.js because it's not platform specific. It's an initialization of a Discord client, both eris, djs, and others have the concept of client initialization.