discord-diabetes / diabot

A diabetes-oriented chatbot for Discord
https://discord.gg/diabetes
Other
21 stars 13 forks source link

Show basal rate on Nightscout embeds #127

Open p5nbTgip0r opened 3 years ago

p5nbTgip0r commented 3 years ago

A user in the r/Diabetes Discord server suggested adding the current basal rate to the Nightscout embeds generated by Diabot.

cascer1 commented 3 years ago

Proposed steps:

  1. Retrieve the most recent temporary basal. If it is still active, then use that.
  2. If the most recent temporary basal is not active, retrieve the most recent profile switch
  3. Parse the embedded profile to get the basal schedule and timezone, then find the current basal rate based on schedule and current time.