ProductivityCoach

Discord Bot made for HackDavis 2018. Attempts to increase productivity and goal achievement via time management, particularly in managing gameplay time. The bot is meant to DM users when their gameplay time is >3 hours, while giving a reminder at 1 and 2 hours to stop playing. The bot also helps run a Pomodoro timer, in which the bot will ping the user after 25 minutes and 5/15 minute breaks. Another addition is the bot's ability to have the user set 'goals' and 'deadlines', and will ping the user when the deadline approaches. Coded in Python.

Challenges:

Given that I am not a CS major and have only been earnestly self-learning Python for the past month, I found a lot of difficulty in what was probably beginner level stuff. I had some difficulty implementing cogs at first, and then I spent a lot of time working out the timer function for the Study cog (I then realized I could use self variables declared in the init method to keep track of times outside of the individual commands). I decided to do this project for this hackathon, because I have previously coded a discord bot in python (my only other repo on GitHub) that I used to help learn Python in the first place. My familiarity with getting that to work (albeit the code is messy, and I plan to use the cogs that I learned this hackathon to clean it up) and the simple idea of having a game time reminder bot seemed like it would be a good idea to do for my first hackathon. Nothing too crazy, but instead I made a push for making more legible and cleaner code by utilizing cogs/classes this time. I learned a lot!

Available commands (prefix : +)

Study:

  • [timer]: Starts the Pomodoro timer sequences beginning with a 25 minute session.

  • [time_left]: Tells you the remaining time left for a session or break.

  • [end]: Ends current session.

GameTimer:

  • [playtime]: Lets you know how long you've been playing. Only usable when bot is there to see a change in status (from not playing to playing). If not playing any games, will let you know for how long.

  • [free]: Changes your 'status' to the bot to not send you game reminders. Use the command [busy] to set this again.

Goals:

  • [goal] [add/remove]: Adds or removes a goal from 'to-do list'. After adding a goal, prompts user for setting a deadline for the goal in MM-DD-YYYY format. Will send a reminder to the user on the deadline.

  • [todo]: View the to-do list and deadlines.

Work left:

  • Detect when a user goes idle and automatically change the toggle in game_timer to 'free', and back to 'busy' when user goes out of idle while in-game.

  • Prevent user from setting deadlines that are already past.

  • Allow user to not set a deadline (defaults to just being on to-do list)

  • Allow user to add more reminders before a deadline (alert x days before deadline.)

*Fix task destroyed.

Ideas:

  • Points system: Keep track of a users' point gain using this bot, input into [userid]-points.csv to save data. Data format will be constant appends of date, points gained that day, total points so far. User's point gain totals can not go past 0.

  • Productivity timer: times study sessions with breaks, notifies you via messages (does not rely on your current status changes). Add command to stop productivity timer. For each study session completed, award 10 points. For each break, award 2 points.

  • Gameplay timer: Reminds you when you are playing a game if gameplay time exceeds a certain time frame (customizable, default 2 hours? 1 hour?). If user stops playing a game <2 hours? 2.5 hours?, award 10 points with -5 points for every 10 minutes afterwards. Can go to negatives and will penalize the user's total point gain.

  • Motivational blurbs: Messages you with daily motivational quotes/pictures/etc.

  • Goal reminders: Set multiple goals with deadlines (if no deadline, then bot will prompt for goal completion at weekly intervals). Bot will do several reminders at different intervals leading up to the deadline, and ask if user has completed the goal (or user can "command" the bot they completed a goal). For each goal completed, award user 10 points + 5 points per day done earlier. If goal is within same day, requires a time (in military) for deadline. If no deadline given, bot will assume deadline is at 23:59 of that day. No points are awarded for goals set with times <1 hour of current time.

Adding the bot:

Recommended to download the repo and host your own bot. Bot is not public on Discord.

Repos used:

discord.py

Referenced:

discord BasicBot, discord BasicBot rewritten with cogs example

Built With

Share this project:

Updates