Giter Club home page Giter Club logo

discord-live-stats's Introduction

Discord server

Discord-Live-Stats Dashboard

The ultimate package for checking Shard-Live-Stats & Bot-Live-Stats. See & get informed and get control over each Shard.

Features:

  • Shard & Bot Status, RAM, CPU, PING, GuildCount & Last Message (Debug Message)
  • Kill specific Shards with a Button

On Work:

  • Manage Shard from Dashboard (respawn...)
  • Guild Rentention
  • Notification on Discord & Browser, when Shards are offline
  • Commands Stats & User Activity

Showcase:

See below for the Docs

If you need help feel free to join our discord server. We will provide you all the help you need โ˜บ

Download

You can download it from npm:

npm i discord-live-stats
  • Typings are on work for TypeScript-Devs

Getting Started:

First of all, you have to create a new File, which can be named server.js.

In the server.js File you will need to insert the Code below, and install the NPM Package express by using npm i express

Scroll down for Api References

File: server.js

const Stats  = require('discord-live-stats');

const express = require("express");
const app = express();

const client = new Stats.Server(app, {
    bot: {
        name: "Your Bot Name",
        icon: "Your Discord Bot Avatar URL",
        website: "Your Website URL",
        client_id: "Discord Bot ID",
        client_secret: "Discord Bot Client_Secret (Not Token)"
    },
    stats_uri: "http://localhost:3000/", //Base URL
    redirect_uri: "http://localhost:3000/login", //Landing Page
    owners: ["Bot_Owner1", "Bot_Owner2"],
    authorizationkey: "Your Password for verifying requests",
})

client.on('error', console.log)

app.listen(3000, () => {
  console.log("Application started, listening on port 3000!");
});

You can start now start your Dashboard with node server.js.

Go to the Discord Developer Portal and to Authorization and insert your redirect_uri there

Now go to the stats_uri link or your choosen link and you should be redirected to the Dashboard with no Data.

Pushing Data of your Client on the Dashboard

Follow the upper step before doing this step.

Open your bot.js File, where you login in the Client and insert this:

File: bot.js

const Stats  = require('discord-live-stats');
const Discord = require('discord.js');
const client = new Discord.Client()

const Poster = new Stats.Client(client, {
    stats_uri: 'http://localhost:3000/',
    authorizationkey: "Your Password for verifying requests | Same as in Server.js",
})
/*
* YOUR BOT CODE STUFF
*/
client.login(`Your_Bot_Token`)

When you start your bot with or without Sharding, the Dashboard should show some information such as Status, Ram, Cpu, Ping, Guildcount and more data of each Shard and of all guilds in total.

API References:

new Server(EXPRESS_APP, config) && new Client(DISCORD_CLIENT, config)

Config Options Default Description
bot.name 'required' The Discord Bot Name
bot.icon 'required' The icon url for the html page
bot.website 'required' The Bot Website on the Footer
bot.client_id 'required' The Discord Bot ID
bot.client_secret 'required' The Discord Bot's Client Secret (Not Token)
stats_uri 'required' The Base Dashboard Link
redirect_uri 'required' The Discord Bot Redirect Url after authorization
scope ['indentify'] Scopes, which should be used for authorization
owners 'required' Array of Bot Owners, which can access the Dashboard
postinterval 1000ms The Post Interval of the new client data
login_path '/' The Path, where you can authorize yourself for accessing the Dashboard
authorizationkey 'required' A random chosen Password/Key, which is used for verifying requests.
markShardasDeadafter 5000ms How long to wait until the Shard is marked as dead on the Dashboard, when no new Data has been recieved

Have fun! and feel free to contribute/suggest or contact me on my Discord Server or DM me Meister#9667

Bugs, Glitches and Issues

If you encounter any problems, feel free to open up an issue in our github repository or join our discord server!

Credits

Partial Credits goes to ADMIN LTE for a good Starter Template, CSS and the Plugins...

When you create Forks of this Package, do not remove the Credits :)

discord-live-stats's People

Contributors

meister03 avatar giingu avatar lightningbolt62 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.