Commission Docs
A Discord bot that collects data from users with a specific role and then displays it on an openly accessed website which will have the data displayed in a table.
Table of Contents:
ID
Username
Roles
Join Date
Avatar
This will be written in JavaScript using Discord.js and Express.js libraries to obtain and display the collected data.
Every x seconds/minutes (rate limit depending) the bot collects users that have a role within the configuration of roles.
If the user has a role, the above data is collected and stored in the applications memory
The data is then displayed via the Express.js web-application on a variety of routes, both in an API and rendered state.
Whatever is desired can be done with this data
A rendered route will be on the applications index, and;
An API route with raw JSON data will be located via GET /api
With the code being open, these routes can always be changed
No login will be required for the rendered page as per discussion. If the API route is wanting to be locked, that can be organised within the scope of the quote at no additional cost.
users-with-role/
├─ webapp/
│ ├─ static/
│ │ ├─ main.css
│ ├─ views/
│ │ ├─ index.ejs
├─ index.js
├─ package.json
├─ package-lock.jsonhttps://weblutions.com/u/DGD9Il.mp4
Download and extract the contents of the RAR file
Edit the ENV configuration file to your own liking
For the Discord bot, make sure all intents are selected
With Node/NPM run npm install from within the install location in a command prompt or shell
Start the application with node . to start the application
Installing node.js: Using Node Version Manager
Installing LEMN Stack: LEMN Stack Install
Screen Sessions: How to Use Screen Sessions on Linux
# The Discord server ID to be monitoring
GUILD_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Role IDs which can be multiple by using a comma
ROLE_IDS=roleid1,roleid2,roleid3
# Whether to use server nicknames or the users username
USE_NICKNAMES=true
# The Discord bot token, all intents should be enabled
DISCORD_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# The port the express application will run on
EXPRESS_PORT=3000Thank you for ordering a commission from Weblutions
If you require additional support contact us