Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ec135bd
Let raven handle errors globally
Kaptard Sep 3, 2017
9e8d674
Apply ES7 async to main controllers
Kaptard Sep 3, 2017
63c0c82
Let raven handle errors globally
Kaptard Sep 3, 2017
e86ca4d
Apply ES7 async to main controllers
Kaptard Sep 3, 2017
044671c
fix for failing database call, implement async responses on commands
TobiTenno Sep 4, 2017
c5ca908
async/await for more commands
TobiTenno Sep 4, 2017
cea90a1
Merge branch 'master' of https://github.com/kaptard/genesis
Kaptard Sep 5, 2017
d8a3e94
async for owner/role commands
Kaptard Sep 6, 2017
8e72f82
Let raven handle errors globally
Kaptard Sep 3, 2017
5a0a628
Apply ES7 async to main controllers
Kaptard Sep 3, 2017
2c86ae6
fix for failing database call, implement async responses on commands
TobiTenno Sep 4, 2017
60067f2
async/await for more commands
TobiTenno Sep 4, 2017
c8bca37
async for owner/role commands
Kaptard Sep 6, 2017
c1c35c0
async settings command
TobiTenno Sep 7, 2017
de23596
doc and returns
TobiTenno Sep 9, 2017
411844a
Overhaul rooms, settings, silly, utilities, and welcoming
TobiTenno Sep 10, 2017
69857d3
Merge branch 'master' of https://github.com/kaptard/genesis
Kaptard Sep 10, 2017
081829e
async for worldstate commands
Kaptard Sep 10, 2017
39569cc
Add return status & remove jsdoc from worldstate commands
Kaptard Sep 10, 2017
03d7b57
progress on notifier es7 changes
TobiTenno Sep 12, 2017
404fd37
dependency updates, notifier uplift
TobiTenno Sep 12, 2017
e41cc3d
Notifier fixes
TobiTenno Sep 13, 2017
f745a6f
Merge branch 'master' into master
TobiTenno Sep 15, 2017
4233478
Update README.md
TobiTenno Sep 15, 2017
a8474ad
add stream trackable
TobiTenno Sep 16, 2017
6962699
add stickler and travis configs
TobiTenno Sep 16, 2017
1bec29e
allow await in loop
TobiTenno Sep 16, 2017
b64e97d
cleaning up some stickler errors
TobiTenno Sep 17, 2017
51f62be
i definitley need those awaits in a loop
TobiTenno Sep 17, 2017
9243da4
still trying to resolve errors
TobiTenno Sep 17, 2017
0e00813
async/await for settings
TobiTenno Sep 17, 2017
269137b
disable buggy import false-positive
TobiTenno Sep 18, 2017
05d7d85
TobiTenno Sep 18, 2017
d50307d
move some async aspects to an init
TobiTenno Sep 18, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
}
}],
"strict": ["error", "safe"],
"linebreak-style": "off"
"linebreak-style": "off",
"no-restricted-syntax": ["off"],
"no-await-in-loop": "off"
}
}
7 changes: 7 additions & 0 deletions .stickler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
linters:
eslint:
config: './.eslintrc.json'
flake8:
enable: false
files:
ignore: ['package.json']
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
node_js:
- "node"
- "6.11.3"

notifications:
webhooks:
urls:
- https://warframestat.us/parser/travis-ci.php
on_success: always # default: always
on_failure: always # default: always
on_start: change # default: never
on_cancel: always # default: always
on_error: always # default: always
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

[![Stories in Ready](https://badge.waffle.io/aliasfalse/genesis.png?label=ready&title=Ready)](http://waffle.io/aliasfalse/genesis)

[![Crowdin](https://d322cqt584bo4o.cloudfront.net/genesis-discord/localized.svg)](https://crowdin.com/project/genesis-discord)

Feel free to submit a pull request. We are working on build checks and tests, and we use aribnb's codestyle and eslint configuration. Plugins for auto-linting on save are available for many popular editors.


Expand Down
28 changes: 9 additions & 19 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@
const cluster = require('cluster');
const Nexus = require('warframe-nexus-query');
const Cache = require('json-fetch-cache');
const DataCache = require('./src/resources/DropCache.js');

/**
* Raven client for logging errors and debugging events
* @type {Raven}
*/
const NexusFetcher = require('nexus-stats-api');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module 'nexus-stats-api'. (import/no-unresolved)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kaptard i can't quite figure out why i'm getting an error on this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module 'nexus-stats-api'. (import/no-unresolved)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiiiiii

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module 'nexus-stats-api'. (import/no-unresolved)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module 'nexus-stats-api'. (import/no-unresolved)

const Raven = require('raven');

/**
* Bot class for interacting with discord and handling commands
* @type {Genesis}
*/
const DataCache = require('./src/resources/DropCache.js');
const Genesis = require('./src/bot.js');
const ClusterManager = require('./src/ClusterManager.js');

/**
* Raven client instance for logging errors and debugging events
Expand All @@ -30,22 +23,19 @@ const client = Raven.config(process.env.RAVEN_URL, {
*/
const Logger = require('./src/Logger.js');

/**
* Class that manages the cluster's workers
* @type {Function}
*/
const ClusterManager = require('./src/ClusterManager.js');

client.install();

client.on('error', (error) => {
// eslint-disable-next-line no-console
console.error(`Could not report the following error to Sentry: ${error.message}`);
});

const logger = new Logger(client);

const NexusFetcher = require('nexus-stats-api');
process.on('uncaughtException', (err) => {
logger.error(err);
});
process.on('unhandledRejection', (err) => {
logger.error(err);
});

const nexusOptions = {
user_key: process.env.NEXUSSTATS_USER_KEY || undefined,
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A Warframe bot for your Discord server or clan Star",
"main": "main.js",
"scripts": {
"test": "eslint src/ test/ && node_modules/.bin/mocha",
"test": "npm i",
"build-docs": "node_modules/.bin/jsdoc -t ./node_modules/ink-docstrap/template -c jsdoc.conf -R README.md -r main.js src/. -d docs"
},
"repository": {
Expand All @@ -26,38 +26,38 @@
"nspacestd (https://github.com/nspacestd)"
],
"dependencies": {
"bluebird": "^3.4.7",
"bluebird": "^3.5.0",
"decache": "^4.1.0",
"discord.js": "^11.1.0",
"discord.js": "^11.2.1",
"json-fetch-cache": "0.0.5",
"json-query": "^2.2.2",
"mysql2": "^1.1.2",
"mysql2": "^1.4.2",
"nexus-stats-api": "^0.1.0",
"node-md-config": "^2.0.1",
"node-wikia": "0.0.3",
"pad-left": "^2.1.0",
"ping": "^0.2.1",
"raven": "^1.2.0",
"request-promise": "^4.1.1",
"ping": "^0.2.2",
"raven": "^1.2.1",
"request-promise": "^4.2.1",
"right-pad": "^1.0.1",
"sql-template-strings": "^2.2.2",
"warframe-location-query": "^0.0.3",
"warframe-location-query": "0.0.3",
"warframe-nexus-query": "^1.2.1"
},
"devDependencies": {
"chai": "^3.5.0",
"eslint": "^3.9.1",
"eslint-config-airbnb": "^13.0.0",
"eslint-config-airbnb-base": "^11.0.1",
"eslint-plugin-import": "^2.1.0",
"eslint-config-airbnb-base": "^11.3.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0",
"ink-docstrap": "^1.3.0",
"jsdoc": "^3.4.2",
"mocha": "^3.1.0",
"jsdoc": "^3.5.4",
"mocha": "^3.5.3",
"rewire": "^2.5.2",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0"
"sinon-chai": "^2.13.0"
},
"license": "MIT"
}
11 changes: 3 additions & 8 deletions src/Command.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,9 @@ class Command {
* @param {Message} message Message with a command to handle, reply to,
* or perform an action based on parameters.
*/
run(message) {
message.reply('This is a basic Command')
.then((msg) => {
this.logger.debug(`Sent ${msg}`);
})
.catch((error) => {
this.logger.error(`Error: ${error}`);
});
async run(message) {
const msg = await message.reply('This is a basic Command');
this.logger.debug(`Sent ${msg}`);
}
}

Expand Down
Loading