The node.js v18 API wrapper for discordlist.gg

Overview

About

This is an unofficial discordlist.gg package written for Typecript and JavaScript to interact with its public API. If you need help using this package, join the maintainer's Support Server, if you need help with the website or the raw API, join the official Support Server and ask friendly there.

All examples are written for TypeScript, if you use JavaScript, please use the comment one line below instead.

Install

Download this npm package to use in your project with

npm install dlist.js
## or
yarn add dlist.js

Create Client

To be able to interact with the api, you have to create a client, in the client's option you have to provide the discordlist.gg-token.
To get your token please visit https://discordlist.gg/bot/<BOT_ID>/dashboard/webhooks and look for the Token section.

import { Client } from 'dlist.js';
//js: const { Client } = require('dlist.js');

const client = new Client({
    token: 'xxx',
    bot: '857230367350063104',

    // if you want to use the voting webhook:
    webhook: {
        port: 3000,
        authorization: 'abc',
        listenCallback: () => console.log('web server ready')
    }
});

Posting Guild data

To dispaly the count in how many guilds your bot is in

client.postGuilds(500);

Voting webhook

If you use this, you have to add the 'webhook' part in #Create Client to be able to recieve events. In the next, head over to https://discordlist.gg/bot/<BOT_ID>/dashboard/webhooks again, and enter your servers IP and port in the Webhook URl field, as example: http://123.456.78:3000. In the Webhook Authorization field, create some strong key and treat it like a password, the same value has to be entered in the #Create Client.webhhok.authorization in order to work!

client.on('vote', data => {
    console.log(data);
    /* {
        user_id: '857230367350063104',
        bot_id: '821472922140803112', 
        is_test: true
        }
    */
});
You might also like...

Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram.

Unimore-Bot Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram I

Jun 9, 2022

A Discord - Telegram bridge rewrote from scratch, in Node.js

Discord-Telegram-bridge A small and fast telegram to discord chat bridge, written in Node.js Setup: If you want to run it on heroku, you can just clic

Apr 14, 2022

Easy and simple twitch bot in node.js.. very very easy..

Easy and simple twitch bot in node.js.. very very easy..

How It Works identity: { username: 'YOUR BOTS USERNAME', -- This is where you place the username that you gave the bot account password: '

Dec 18, 2021

This bot is a cool Discord bot made in discord.js using Node.JS

This bot is a cool Discord bot made in discord.js using Node.JS

Anti-Crosspost Discord Bot This bot is a cool Discord bot made in discord.js using Node.JS. It detects when a user cross-posts a message in multiple c

May 31, 2022

🤖 NODE.TS - Play a welcome sound every time someone joins the voice channel, meme bot. (Olha ele ae)

welcome2voice-bot 🤖 NODE.TS - Play a welcome sound every time someone joins the voice channel. 🤖 INVITE-ME 🤖 Installation Clone project git clone g

Feb 23, 2022

Denky is a multipurpose Discord bot, build with Node.js, TypeScript and discord.js.

🤖 Denky Bot Denky is a brazilian Discord bot, build with Node.js, TypeScript and discord.js. ⚙️ How to Create a Discord application. Guide Install No

Apr 6, 2022

A easy way for making bots using Discord.js/Node.js

Discord.js-Bot-Template This is a very simple template for making bots using Discord.js/Node.js Tutorial: To begin, Install Node.js here. After Node.J

Nov 8, 2022

a Node.js boilerplate to start creating your telegram bot without too much configuration at the beginning

node-telegram-bot-starter-pack How to use clone the repo run npm install run cp .env.example .env and replace the variables with your data define your

Sep 7, 2022

Denky is a multipurpose Discord bot used in +3000 servers. Built with Node.js, TypeScript and discord.js.

🤖 Denky Bot Denky is a brazilian Discord bot, built with Node.js, TypeScript and discord.js. ⚙️ Self hosting ⚠️ Support will not be provided for self

Dec 26, 2022
Comments
  • Error with node.js

    Error with node.js

    Error code:

    {
      "error": {
        "message": "Must use import to load ES Module: /opt/node_modules/node-fetch/src/index.js\nrequire() of ES modules is not supported.\nrequire() of /opt/node_modules/node-fetch/src/index.js from /opt/node_modules/dlist.js/dist/client/RestManager.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /opt/node_modules/node-fetch/package.json.\n",
        "stack": "Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /opt/node_modules/node-fetch/src/index.js\nrequire() of ES modules is not supported.\nrequire() of /opt/node_modules/node-fetch/src/index.js from /opt/node_modules/dlist.js/dist/client/RestManager.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /opt/node_modules/node-fetch/package.json.\n\n    at new NodeError (internal/errors.js:322:7)"
      }
    }
    
    bug 
    opened by DanielGolan-mc 5
  • Bump jsonwebtoken from 8.5.1 to 9.0.0

    Bump jsonwebtoken from 8.5.1 to 9.0.0

    Bumps jsonwebtoken from 8.5.1 to 9.0.0.

    Changelog

    Sourced from jsonwebtoken's changelog.

    9.0.0 - 2022-12-21

    Breaking changes: See Migration from v8 to v9

    Breaking changes

    Security fixes

    • security: fixes Arbitrary File Write via verify function - CVE-2022-23529
    • security: fixes Insecure default algorithm in jwt.verify() could lead to signature validation bypass - CVE-2022-23540
    • security: fixes Insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC - CVE-2022-23541
    • security: fixes Unrestricted key type could lead to legacy keys usage - CVE-2022-23539
    Commits
    • e1fa9dc Merge pull request from GHSA-8cf7-32gw-wr33
    • 5eaedbf chore(ci): remove github test actions job (#861)
    • cd4163e chore(ci): configure Github Actions jobs for Tests & Security Scanning (#856)
    • ecdf6cc fix!: Prevent accidental use of insecure key sizes & misconfiguration of secr...
    • 8345030 fix(sign&verify)!: Remove default none support from sign and verify met...
    • 7e6a86b Upload OpsLevel YAML (#849)
    • 74d5719 docs: update references vercel/ms references (#770)
    • d71e383 docs: document "invalid token" error
    • 3765003 docs: fix spelling in README.md: Peak -> Peek (#754)
    • a46097e docs: make decode impossible to discover before verify
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by julien.wollscheid, a new releaser for jsonwebtoken since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Suggestion: add a way to figure out flags

    Suggestion: add a way to figure out flags

    [
      {
        avatar: '96a6725be0d2d2dbb4fd38cb90063e3c',
        briefDescription: 'Portal - to anything dlist.gg! Find & Invite bots directly in discord',
        coOwnerIds: [],
        createdOn: '2022-06-03T19:36:35+00:00',
        discriminator: 4883,
        features: '128',
        flags: '128',
        guildCount: 6,
        id: '968902660218585098',
        inviteUrl: 'https://discord.com/oauth2/authorize?client_id=968902660218585098&permissions=517610982464&scope=bot%20applications.commands',
        ownerId: '453542039242539019',
        prefix: null,
        tags: [ 'english', 'knowledgebase', 'server-management' ],
        username: 'Portal',
        votes: '5'
      }
    ]
    

    As you can see, this is my bot's details json. I would suggest to add a way to figure out what flags and features actually mean.

    enhancement 
    opened by DanielGolan-mc 0
  • Suggestion: add a code linter

    Suggestion: add a code linter

    Why a linter is necessary

    As this project evolves, it’s inevitable that there will be bugs introduced that the TypeScript compiler simply isn’t designed to detect. A linter such as ESLint, with the help of the TypeScript ESLint parser, can detect issues like stringifying an object, forgetting to handle promise rejections, or misusing any (which is, frankly, defeats the purpose of using TypeScript and is an accident waiting to happen). It can also enforce stylistic decisions, like consistent privacy modifiers on classes and the usage of namespaces.

    TSLint vs ESLint

    While the TSLint linter is clearly designed for TypeScript, it has been deprecated and superseded by ESLint with the typescript-eslint parser. I would recommend using ESLint.

    opened by ghost 0
Releases(0.4.2)
  • 0.4.2(Aug 17, 2022)

    Bug fixes

    • fixing node-fetch requests (ddbca971f6400eba03bb3b38f6b24f7c68eba930)
    • fix getBot() not using it's own id (f00c8374c3b65e919ea8aa6dbe1c41c17527207a)
    Source code(tar.gz)
    Source code(zip)
  • v0.3(Jun 10, 2022)

    Features

    • add support for node.js v<18

    Bug fixes

    • fixed voting body (cf0247a8f02998369c02c005263355c77217a192)
    • fix not defined error if not using webhook (ad630ccfc8aa0b1dc69fef2079388065a15981b0)
    Source code(tar.gz)
    Source code(zip)
  • v0.2(Jun 2, 2022)

    Features

    • add event listener to client (9adf52d4b4a11700eda4bbb7f023f23324d59ff5)
    • add client.on('vote', data) to receive votes (a49b691c711cc6d4e361dfc7864e6336db848bfb)
    • add client.on('invalidVoteRequest', data) to receive failed vote requests (a49b691c711cc6d4e361dfc7864e6336db848bfb)

    Bug fixes

    • fixed imports in readme (96fb61a7745ac5f0b807515d54b1748c896ebe4a)
    Source code(tar.gz)
    Source code(zip)
  • stable(Jun 1, 2022)

    Features

    • client.postGuilds(<number>) has been added to post bot's guild count (1e46acb)
    • restManager has been added to perform requests (92f8ff6)

    Bug fixes

    • dependencies moved to devDependencies (de98e98)
    Source code(tar.gz)
    Source code(zip)
A lavalink wrapper in Node.js

Vulkava A lavalink wrapper in Node.JS Documentation Common errors/Issues ?? Installation You will need NodeJS v14+ and a running lavalink server. Offi

David Amorim 26 Dec 17, 2022
Easiest medium to use buttons with any discord API wrapper

Discord Buttons Plugin Easiest medium to use buttons with any discord API wrapper /* Generate 1st Button with "Yes" lable on it */ const button1

CTK WARRIOR 17 May 14, 2022
spotify.ts is an wrapper built around Spotify's Web API

spotify.ts About spotify.ts is an wrapper built around Spotify's Web API. Features Fast Object Oriented Typescript, ESM, CJS support Easy to Use Insta

null 6 Nov 17, 2022
Unofficial javascript wrapper to WhatsApp Cloud API.

heyooh Unofficial javascript wrapper to WhatsApp Cloud API. Its the javascript port for heyoo Features supported Sending messages Sending Media (image

JS Hub Zimbabwe 24 Dec 30, 2022
A wrapper for @discordjs/voice

ezvoice A lightweight package designed to make it just a bit easier to play and record sound with @discordjs/voice Discord: nab138#2035 Examples Conne

null 0 May 19, 2022
Featureful selfbot wrapper for its Discord selfbot

Featureful Selfbot wrapper for its Discord Selfbot. This library provides non-standard stuff such farming, intervals, and respect the ratelimit.

null 5 Nov 30, 2022
🎸 foolproof wrapper to stream what you're currently listening to

A lightweight Spotify API wrapper that allows you to display the music you're currently listening to ?? ?? ?? Getting started ⏪ Prerequisites Create a

null 11 Dec 29, 2022
A Node JS Express/Serverless demo application that creates a slideshow video using the Pexels image library and Shotstack video editing API.

Shotstack Pexels Slideshow Video Demo This project demonstrates how to use the Shotstack cloud video editing API to create a video using an HTML form

Shotstack 25 Dec 9, 2022
dscbots.js is a Node.js module that allows you to interact with the Discord API without any complications.

Credits Goodsie - Helping me with the websocketmanager About dscbots.js is a Node.js module that allows you to interact with the Discord API without a

Scarlot Spy 0 Nov 29, 2022
Simple WhatsApp MD BOT. Get a API key from ZEN API

ALIEN ALFA-MD Contact Me: ❗❗FORK THIS BEFORE PROCEEDING Use This Button To Fork Now Scan QR Code For Session Change Session In Github ⚠️ Session Chang

TOXIC ALIEN 46 Dec 28, 2022