discord-diabetes / diabot Goto Github PK
View Code? Open in Web Editor NEWA diabetes-oriented chatbot for Discord
Home Page: https://discord.gg/diabetes
License: Other
A diabetes-oriented chatbot for Discord
Home Page: https://discord.gg/diabetes
License: Other
Diabot should add a setting (configurable by admins) to use shorter nightscout responses. The card is nice but takes up a lot of space, especially when used often.
For example:
Name: mmol/L: 6.1(+0.3) | mg/dL: 109(+5) | trend: → | iob: 0.56 | cob: 3 | Today at 8:01 PM
The admin command to add or remove channels from the list of channels that receive short responses could be:
diabot nsadmin shortchannels add #diabetic-chat
or diabot nsadmin shortchannels remove #regular-chat
(Thanks to Telani)
Users should be able to convert between mmol/L and mg/dL blood glucose levels in several ways:
My bg when I woke up was _7.3_!
)I'm currently at 130 mg/dL
)Preferably, multiple inline notations in the same message should all be converted
Use conversion logic from #2
Allow users to configure a nightscout url (nightscout set <url>
), and then allow them to request the status without including a domain (nightscout
)
possibly also accept nightscout @user
to see their configured status, if available.
When a message contains multiple inline BG values, all should be converted
inline BG values can be _underscored_
or followed by a unit mmol/mgdl
test
For example typing diabot novorapid/novolog would come up with the activation time and length in body for different types of insulin for easy referral for those who may not know.
Doing certain commands (such as diabot ns public true) and diabot ns set (domain name) either don’t help with hinting what to do (diabot simply says Something about a scheme if you don’t put https://) (setting domain) or doesn’t even tell you to put true (setting ns to public)
Users should be able to get an estimated A1c based on an average BG (either in mmol/L or mg/dL)
Users have the option to set a custom Nightscout title (environment variable CUSTOM_TITLE
in Nightscout. We should display this title in the nightscout response when it is present.
Command parsing can be provided by JDA utilities
example: a URL has the number 59 in it somewhere, diabot will butt in and say "59mgdl is X mmol"
IOB Display feature,
Device Status OpenAPS/AAPS Example:
[
{
"_id": "5bd7589cf56a912fced39f5b",
"device": "openaps://Google Pixel 3 XL",
"pump": {
"battery": {
"percent": 50
},
"status": {
"status": "normal",
"timestamp": "2018-10-29T18:59:39Z"
},
"extended": {
"Version": "2.0i-dev-54b3e60f4-2018.10.17-16:27",
"ActiveProfile": "New Default",
"TempBasalAbsoluteRate": 0.37199999999999994,
"TempBasalStart": "10/29/18 2:55 PM",
"TempBasalRemaining": 25
},
"reservoir": 50,
"clock": "2018-10-29T18:59:39Z"
},
"openaps": {
"suggested": {
"temp": "absolute",
"bg": 236,
"tick": "+8",
"eventualBG": 194,
"insulinReq": 1.92,
"deliverAt": "2018-10-29T18:59:39.456Z",
"sensitivityRatio": 1.2,
"predBGs": {
"IOB": [
236, 243, 248, 253, 256, 258, 258, 258, 256, 254, 250, 245, 240, 234, 229, 223, 218, 213, 208, 204, 199, 195, 191, 187, 183, 180, 176, 173, 170, 167, 164, 162, 159, 157, 155, 153, 151, 149, 148, 146, 145, 144, 143, 142, 141, 140, 139, 138
],
"ZT": [
236, 231, 226, 221, 215, 209, 204, 198, 192, 187, 182, 176, 171, 166, 162, 157, 153, 149, 145, 142, 138, 135, 133, 130, 128, 126, 124, 123, 122, 121, 120, 120, 119, 119, 119, 119, 120, 120
],
"UAM": [
236, 243, 250, 255, 260, 264, 268, 270, 272, 274, 275, 275, 275, 274, 272, 271, 268, 266, 262, 259, 255, 250, 246, 242, 239, 235, 232, 228, 225, 222, 220, 217, 215, 212, 210, 208, 207, 205, 203, 202, 200, 199, 198, 197, 196, 195, 195, 194
]
},
"COB": 0,
"IOB": 5.782,
"reason": "COB: 0, Dev: 77, BGI: -5, ISF: 29, CR: 5.5, Target: 110, minPredBG 166, minGuardBG 193, IOBpredBG 138, UAMpredBG 194; Eventual BG 194 >= 110, insulinReq 1.92; maxBolus 0.6; setting 30m low temp of 0.62U/h. Microbolusing 0.6U. ",
"units": 0.6,
"rate": 0.62,
"duration": 30,
"timestamp": "2018-10-29T18:59:39Z"
},
"iob": {
"iob": 5.782,
"basaliob": 0.23900000000000002,
"activity": 0.033600000000000005,
"time": "2018-10-29T18:59:39Z"
}
},
"uploaderBattery": 90,
"created_at": "2018-10-29T18:59:39Z",
"NSCLIENT_ID": 1540839579493
}
]
Pebble Endpoint example:
{
"status": [
{
"now": 1540839651743
}
],
"bgs": [
{
"sgv": "236",
"trend": 3,
"direction": "FortyFiveUp",
"datetime": 1540839559000,
"bgdelta": 8,
"battery": "90",
"iob": "5.78",
"bwp": "-2.19",
"bwpo": 34,
"cob": 0
}
],
"cals": []
}
Some of the advanced features we're planning require a database connection. This issue tracks the progress of this.
some people might not want rewards
diabot rewards leave
diabot rewards join
With all the fields we're adding to the Nightscout cards, some users might prefer simple cards that contain only BG data.
diabot ns setsimple <true/false>
Allow diabot to enforce username rules
diabot admin usernames set <pattern>
to set patterndiabot admin usernames enable
to enable enforcementdiabot admin usernames disable
to disable enforcementdiabot admin usernames pattern
to view patterndiabot admin usernames replacement <replacement>
to view or set the replacement nameset
command to merge with pattern
When someone gives a reading in the chat of 6.9mmol or 69mg the bot should reply with the conversion and followed by a 😏 emoji.(https://emojipedia.org/smirking-face/)
I understand this is not useful but is fun. Maybe only triggered 5% of the time or something.
I'd like to be able to see a small graph embedded into Discord when I get data from the bot, as then it would be easier (for the user) than taking screenshots and uploading
If the command 'diabot github' was given then give the link to the GitHub so that people can have easier access if they think of a good idea or there is an idea that someone in the discord thinks of.
mg/dL values should always have zero decimals.
very bad
Is your feature request related to a problem? Please describe.
Sometimes the Nightscout entries API endpoint (/api/v1/entries.json
) does not include a delta. This makes it so that the delta is also not displayed in the NS card (diabot nightscout
)
Describe the solution you'd like
manually calculate the delta by gathering the two most recent entries and doing some simple math
Describe alternatives you've considered
disabling Dexcom share
Additional context
Original reporter: accio-books
info set
and nightscout set
) it will always show help for the first found command (in this case nightscout set
)Not all Nightscout instances are public. Add support for auth
diabot ns setauth <token>
Since 69mg and 6.9mmol both get smirks, despite meaning two different things, it seems only fair to our friends using mmol to get the 💯 emote as a reaction to 10.0mmol as well as 99/100mg.
I respect that this may feel unnecessary, but it will help towards normalizing upper range numbers and temporary setbacks by encouraging people with higher bgs to share their failures as well as their successes. Thank you for your time, and I hope that I can help you work towards a better and brighter future for our beloved Diabot. <3
Bot should be able to assign a configured role, based on whether a user has another configured role or not.
For example:
approved
role should be given the Halloween 2018
rolesub-tasks:
Users should be able to convert BG values between mmol/L and mg/dL.
See old diabot code for information
Seeing the local time for the person who did the command can be interesting seeing if they are having a low late at night or in the middle of the night.
Instead of one ugly list for everything, we should
\u1F4AF
is not a valid emoji according to Discord.
Should use \uD83D\uDCAF
instead
People who don't use Heroku also have rights 😢
Users should be able to request an average BG (in mmol/L or mg/dL) based on a given A1c
Instead of having to hardcode rewards, it should be possible for admins to configure them using a command
rewards add <requiredRole> <rewardRole>
for example
rewards add @Approved @Halloween
Add the ability to mention a user in the NS command to see their nightscout data
Is your feature request related to a problem? Please describe.
It's a problem that the diaboi ns command doesn't show a picture of Aaron.
Describe the solution you'd like
I'd like the command diaboi ns to show a picture of Aaron.
Describe alternatives you've considered
It could also just show Aaron's PFP Bepis man.
It would be handy to have a quick bot command that explains and links to things that people may not be aware of, but are commonly referred to in chat. For instance !xdrip !spike !nightscout
Having a single simple explanation can make it easier for people to answer questions they may not be fully equipped to explain, and prevents misconceptions about the capabilities of these programs.
Here's some things I threw together really quickly for xdrip+ and Nightscout:
!xdrip
xDrip+ is an open source diabetes management app on Android that allows for more features than official CGM applications. Features include Nightscout upload, compatibility with most CGMs, extended sensor sessions, customizable alerts, bluetooth glucose meter support, and much more. It is available at: https://github.com/NightscoutFoundation/xDrip
!nightscout
Nightscout is an open source, web based tool that allows for real time access to diabetes data. It has many different uses including sharing information with others, disposable supply tracking, alarms, basic predictions, diabetes treatment reports, and much more. It has wide compatibility with many systems including all modern CGMs, DIY artificial pancreas systems, and just about anything able to connect to the internet. More information at: http://www.nightscout.info/ Setup guide at: http://www.nightscout.info/wiki/welcome/set-up-nightscout-using-heroku
I'd do a spike one but I've never used it and the recent re-signing issues should be part of it. Also I'd love suggestions on changes to the above wording.
Trend arrows are awesome.
When the most recent entry is a calibration, we should look at the entry before that.
example calibration response
[
{
"_id": "xxxx",
"device": "xDrip-DexcomG5",
"date": 1541183876774,
"dateString": "2018-11-02T14:37:56.774-0400",
"slope": 1384.1885140433599,
"intercept": -19547.12370947527,
"scale": 1,
"type": "cal"
}
]
💯
related to #20 -- kinda.
Server administrators may wish to use diabot to manage rules.
Advantage: all admins (or other configured role) may configure rules for the server; diabot manages rule messages in a rules channel.
Instead of this ugly parsing we do now in some commands (mostly nightscout and estimate), we should consider using JDA subcommands.
If they work anything like I hope they do, at least
Describe the bug
When performing an ambiguous conversion, the source value (i.e 27) is displayed as its converted counterpart.
To Reproduce
27
Expected behavior
Bot shouldn't convert the input unit
Add simplified as a customization option alongside having it required in #general.
#diabetic-chat paraphrased:
If diabot can send PMs like other bots can, then potentially set a reminder function to PM for specific times for those doing insulin at specific times. Basically like a timesulin cap but through discord.
Disclaimer "NOT OUR FAULT IF IT DON'T WORK, DON'T TRUST DUMB INTERNET BOTS TO TAKE CARE OF YOU THX"
Add a command to show information about (i) a specific; or (ii) a specific diacast episode
diabot episode
diabot episode 6
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.