Code Monkey home page Code Monkey logo

diabot-old's People

Contributors

cascer1 avatar codacy-badger avatar

Watchers

 avatar  avatar

diabot-old's Issues

Bot crashes when sent server commands via DM

When the bot receives a DM containing server commands like getServerSetting or registerServer, it crashes.

2016-12-22T09:15:09.912626+00:00 app[worker.1]: /app/lib/functions.js:41
2016-12-22T09:15:09.912637+00:00 app[worker.1]:         let roles = member.roles.array();
2016-12-22T09:15:09.912638+00:00 app[worker.1]:                           ^
2016-12-22T09:15:09.912640+00:00 app[worker.1]:
2016-12-22T09:15:09.912641+00:00 app[worker.1]: TypeError: Cannot read property 'roles' of null
2016-12-22T09:15:09.912642+00:00 app[worker.1]:     at Object.hasAdminRole (/app/lib/functions.js:41:27)
2016-12-22T09:15:09.912643+00:00 app[worker.1]:     at Command.fn (/app/lib/commands/getSetting.js:31:24)
2016-12-22T09:15:09.912644+00:00 app[worker.1]:     at App.parseInput (/app/node_modules/clapp/dist/App.js:322:45)
2016-12-22T09:15:09.912644+00:00 app[worker.1]:     at Client.bot.on.msg (/app/lib/index.js:69:13)
2016-12-22T09:15:09.912645+00:00 app[worker.1]:     at emitOne (events.js:96:13)
2016-12-22T09:15:09.912645+00:00 app[worker.1]:     at Client.emit (events.js:188:7)
2016-12-22T09:15:09.912646+00:00 app[worker.1]:     at MessageCreateHandler.handle (/app/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
2016-12-22T09:15:09.912647+00:00 app[worker.1]:     at WebSocketPacketManager.handle (/app/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:100:65)
2016-12-22T09:15:09.912648+00:00 app[worker.1]:     at WebSocketManager.eventMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:225:31)
2016-12-22T09:15:09.912649+00:00 app[worker.1]:     at WebSocket.ws.onmessage (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:83:37)
2016-12-22T09:15:09.921455+00:00 app[worker.1]:
2016-12-22T09:15:09.929218+00:00 app[worker.1]: npm ERR! Linux 3.13.0-105-generic
2016-12-22T09:15:09.929432+00:00 app[worker.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-12-22T09:15:09.929594+00:00 app[worker.1]: npm ERR! node v6.9.1
2016-12-22T09:15:09.929896+00:00 app[worker.1]: npm ERR! npm  v3.10.8
2016-12-22T09:15:09.930024+00:00 app[worker.1]: npm ERR! code ELIFECYCLE
2016-12-22T09:15:09.930122+00:00 app[worker.1]: npm ERR! [email protected] start: `node ./lib/index.js`
2016-12-22T09:15:09.930194+00:00 app[worker.1]: npm ERR! Exit status 1
2016-12-22T09:15:09.930298+00:00 app[worker.1]: npm ERR!
2016-12-22T09:15:09.930364+00:00 app[worker.1]: npm ERR! Failed at the [email protected] start script 'node ./lib/index.js'.
2016-12-22T09:15:09.930631+00:00 app[worker.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-12-22T09:15:09.930632+00:00 app[worker.1]: npm ERR! If you do, this is most likely a problem with the diabot package,
2016-12-22T09:15:09.930632+00:00 app[worker.1]: npm ERR! not with npm itself.
2016-12-22T09:15:09.930633+00:00 app[worker.1]: npm ERR! Tell the author that this fails on your system:
2016-12-22T09:15:09.930732+00:00 app[worker.1]: npm ERR!     node ./lib/index.js
2016-12-22T09:15:09.930812+00:00 app[worker.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-12-22T09:15:09.930923+00:00 app[worker.1]: npm ERR!     npm bugs diabot
2016-12-22T09:15:09.931134+00:00 app[worker.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-12-22T09:15:09.931135+00:00 app[worker.1]: npm ERR!     npm owner ls diabot
2016-12-22T09:15:09.931136+00:00 app[worker.1]: npm ERR! There is likely additional logging output above.
2016-12-22T09:15:09.953299+00:00 app[worker.1]:
2016-12-22T09:15:09.953527+00:00 app[worker.1]: npm ERR! Please include the following file with any support request:
2016-12-22T09:15:09.953585+00:00 app[worker.1]: npm ERR!     /app/npm-debug.log

Bolus calculator

I'd like the bot to be able to store information per user with a -set command (glucose and carb ratios) and then have the bot calculate the bolus I should give (with an input of glucose level and carbs)
thank yuuu

Reduce risk of stack overflows

Currently, all database promises are saved in an array to ensure everything is handled before the bot can shutdown.

Completed promises (either fulfilled, errors or otherwise no longer waiting) should be removed from this array to ensure it doesn't keep piling on.

Help tables contain color codes on Windows

Help tables containing argument and flag info contain color codes when the bot is running on Windows. This does not appear to happen on Linux.

Windows example

Windows example

Linux example

Linux example

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.