SOCKET STATS | DASHBOARD for DISCORD BOT STATS
This dasboard base on Bootstrap and chart.js. then for the comunication we open a websocket using socket.ioServer statistics Dashboard builder for Discord BOT through WebSocket.
installing this package and complete all requirement, ur project will automatically make websocket server and open new routing following http://localost:8080/gb-status
. or <project_url>/gb-status
The following example attaches project to a plain Node.JS HTTP server listening on port 8080 .
Requirement
this project require following packages:
Installation
install the package using:
$ npm install socketstats
Basic routing
then use express and create express basic routing.
The following example attaches project to a plain Node.JS HTTP server listening on port 8080 .
const express = ;const app = ;const _PORT = processenvPORT || 8080; // routing//.....//.....// routing end // common case listening port given by expressapp
to make WebServer
and WebSocket
run in singgle server. You need to pass the Server
to socketstats
, and not the express application function. Also make sure to call .listen
on the server
, not the app
.
then for gathering info from the bot we need authorize client
fom discord. so we do listen to port after te bot is ready.
const express = ;const app = ;const _PORT = processenvPORT || 8080; // routing//.....//.....// routing end // common case listening port given by express// app.listen(_PORT, () => {// console.log("Listening to port: "+_PORT);// }) // basic discord,js BOT requirementconst Discord = ;const client = Discord; // some handler command// .....// ..... client; // basic discord.js BOT login methodclient