Skip to content

Commit e98ea35

Browse files
authored
Revert "Clean up some DB Calls, other tweaks (#172)" (#173)
This reverts commit e9f190f.
1 parent e9f190f commit e98ea35

File tree

14 files changed

+701
-255
lines changed

14 files changed

+701
-255
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Use the provided `.eslintrc.json` to lint your files, include any ignores in you
2121

2222
### Running
2323

24-
1. Get a bot token from the [discord application dashboard here](https://discordapp.com/developers/applications/me) and use it in a copy of `pm2.json`, we ignore `genesis.json` by default in our `.gitignore`.
24+
1. Get a bot token from the [discord application dashboard here](https://discordapp.com/developers/applications/me) and use it in a copy of `pm2.json`, we ignore `genesis.json` by default in our `.gitignore`.
2525

2626
2. Install [pm2](http://pm2.keymetrics.io/docs/usage/quick-start/).
2727

@@ -33,7 +33,7 @@ Use the provided `.eslintrc.json` to lint your files, include any ignores in you
3333

3434
6. Invite the bot to your server using the format:
3535

36-
`https://discordapp.com/oauth2/authorize?scope=bot&client_id=<bot_client_id>&permissions=<permissions###>`.
36+
`https://discordapp.com/oauth2/authorize?scope=bot&client_id=<bot_client_id>&permissions=<permissions###>`.
3737

3838
### Resources
3939

@@ -43,12 +43,14 @@ Use the provided `.eslintrc.json` to lint your files, include any ignores in you
4343

4444
* warframe-nexus-query [Docs](https://warframe-community-developers.github.io/warframe-nexus-query)
4545

46+
* warframe-location-query [Docs](https://warframe-community-developers.github.io/warframe-location-query)
47+
4648
* Contact Tobiah on Discord [Cephalon Genesis guild](https://discord.gg/0onjYYKuUBHiR3LK)
4749

4850
## Contributors
4951

5052
Nspace
5153
* Awesome dude who's working on porting and updating the accumulated tech debt caused by hubot
52-
54+
5355
Tobiah
5456
* Other dude who's helping, writing features, debugging, and sometimes sleeping

main.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use strict';
22

33
const cluster = require('cluster');
4+
const Nexus = require('warframe-nexus-query');
45
const Cache = require('json-fetch-cache');
6+
const NexusFetcher = require('nexus-stats-api');
57
const Raven = require('raven');
68

79
const DataCache = require('./src/resources/DropCache.js');
@@ -35,6 +37,18 @@ process.on('unhandledRejection', (err) => {
3537
logger.error(err);
3638
});
3739

40+
const nexusOptions = {
41+
user_key: process.env.NEXUSSTATS_USER_KEY || undefined,
42+
user_secret: process.env.NEXUSSTATS_USER_SECRET || undefined,
43+
api_url: process.env.NEXUS_API_OVERRIDE || undefined,
44+
auth_url: process.env.NEXUS_AUTH_OVERRIDE || undefined,
45+
ignore_limiter: true,
46+
};
47+
48+
const nexusFetcher = new NexusFetcher(nexusOptions.nexusKey
49+
&& nexusOptions.nexusSecret ? nexusOptions : {});
50+
51+
const nexusQuerier = new Nexus(nexusFetcher);
3852

3953
const caches = {
4054
pc: new Cache('https://api.warframestat.us/pc', 600000),
@@ -57,7 +71,9 @@ if (cluster.isMaster) {
5771
prefix: process.env.PREFIX,
5872
logger,
5973
owner: process.env.OWNER,
74+
nexusQuerier,
6075
caches,
76+
nexusFetcher,
6177
});
6278
shard.start();
6379
}

0 commit comments

Comments
 (0)