Skip to content

Commit

Permalink
add kdh
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Jul 8, 2019
1 parent 0c5a85b commit 4cc04ea
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
7 changes: 2 additions & 5 deletions bot/index.js
@@ -1,12 +1,9 @@
const { Client } = require('klasa');
const {
token,
clientOptions,
clientProperties
} = require('../config');
const { token, clientOptions, clientProperties } = require('../config');

Client.use(require('@kcp/tags'));
Client.use(require('klasa-textchannel-gateway'));
Client.use(require('klasa-dashboard-hooks'));

require('../config/Schemas');

Expand Down
25 changes: 25 additions & 0 deletions bot/routes/application.js
@@ -0,0 +1,25 @@
const { Route } = require('klasa-dashboard-hooks');
const { Duration } = require('klasa');

module.exports = class extends Route {

constructor(...args) {
super(...args, { route: 'application' });
}

get(request, response) {
return response.end(
JSON.stringify({
users: this.client.users.size,
guilds: this.client.guilds.size,
channels: this.client.channels.size,
shards: this.client.options.shardCount,
uptime: Duration.toNow(Date.now() - process.uptime() * 1000),
memory: process.memoryUsage().heapUsed / 1024 / 1024,
invite: this.client.invite,
...this.client.application
})
);
}

};
13 changes: 13 additions & 0 deletions bot/routes/commands.js
@@ -0,0 +1,13 @@
const { Route } = require('klasa-dashboard-hooks');

module.exports = class extends Route {

constructor(...args) {
super(...args, { route: 'commands' });
}

get(request, response) {
return response.end(JSON.stringify(this.client.commands));
}

};
9 changes: 7 additions & 2 deletions config/index.js
@@ -1,6 +1,6 @@
const emoji = require('./skill-emoji');
const streamers = require('../data/osrs-streamers');
const { token, twitchClientID, twitterApp, dbl } = require('./private.js');
const { token, twitchClientID, twitterApp, dbl, clientSecret, KDHOptions } = require('./private.js');

const production = require('os').platform() === 'linux';

Expand Down Expand Up @@ -48,6 +48,11 @@ module.exports = {
providers: { default: production ? 'rethinkdb' : 'json' },
permissionLevels: require('./PermissionLevels'),
pieceDefaults: { commands: { deletable: true } },
readyMessage: client => `[Old School Bot] Ready to serve ${client.guilds.size} guilds and ${client.users.size} users`
readyMessage: client =>
`[Old School Bot] Ready to serve ${client.guilds.size} guilds and ${client.users.size} users`,
/* KDH */
clientSecret,
clientID: '303730326692429825',
dashboardHooks: KDHOptions
}
};

0 comments on commit 4cc04ea

Please sign in to comment.