cascer1 / diabot-old Goto Github PK
View Code? Open in Web Editor NEWA diabetes themed discord bot
License: GNU General Public License v3.0
A diabetes themed discord bot
License: GNU General Public License v3.0
The bot crashes when a userUpdate event is fired. I believe this only happens if the user that's updated does not have the diabotDebug role.
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
Because diabetes
Even though the bot.destroy()
promise is fulfilled, the bot remains online according to discord.
Instead of having one command to convert between both depending on a flag, create two separate commands without flags
When requesting help for a command with arguments (e.g: -diabot convert --help
), the bot crashes:
ReferenceError: args_table is not defined
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
It's annoying as hell, get rid of it.
Sometimes when registerServer is called, some of the default types (T1D, T2D, LADA, NONE) aren't added to the database.
This channel spam is annoying
so pending messages are handled.
The bot should allow administrators to modify some settings of the bot.
Because managing this thing through commands is annoying
For example, the bot might ask people which type they have (1, 2, lada, etc.) and assign a server group accordingly
Instead of assuming input is mmol/L if no flag is provided, try to guess the input unit.
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.
No longer queue incoming messages and wait for queued messages to be acknowledged.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.