Giter VIP home page Giter VIP logo

rbot's Introduction

Reminder Bot / RBot

A daily reminder bot for GroupMe

Set a reminder for your whole group every day at a specific time.

Reminder bot helpfully reminds the group: Don't forget, meeting is TONIGHT at 6:00!

Reminder bot playfully reminds the group: It's tea time!

Reminder bot respectfully reminds the group: Don't forget to log.

Available Commands

View the full list of available commands. The following are the recommended variations:

Set up the bot

  • Hey Reminder Bot, set reminder to X
  • Hey Reminder Bot, activate

Configure the bot

  • Hey Reminder Bot, set reminder time to X
  • Hey Reminder Bot, set reminder day to (everyday, weekdays, weekends, M/T/W/Th/F/S)
  • format for days can be M/Mo/Monday/Mondays etc
  • Hey Reminder Bot, set reminder time to 6pm on weekdays

Activate the bot

  • Hey Reminder Bot, activate the reminder

Preset the bot

  • Hey Reminder Bot, use the running log preset

Test the bot

  • Hey Reminder Bot, are you awake?
  • Hey Reminder Bot, what is the status?

Getting Started

Confused? Check out these instructions.

  1. Create Heroku App and configure Heroku Scheduler (if running free dyno)
  • Heroku auto-kills your free dynos, so we need to add the Heroku Scheduler add-on
  • Create a new job to run node cron-check.js every 10 minutes
  • If you have a paid dyno that does not shut down, you can skip this step
  1. Create a new GroupMe bot
  • Enter Reminder Bot as the name
  • Enter https://i.groupme.com/1000x1000.png.46ad37818d924567985aa2e7f138f791 as the avatar URL
  • Enter the callback URL. This will be the /hook route of wherever you are deploying. For Heroku, it will be YOUR-APP-NAME.herokuapp.com/hook
  1. Add BOT_ID, GROUP_ID, and DATABASE_URL to the environment variables
  • Include your BOT_ID and GROUP_ID from the GroupMe API bots page
  • Database must be a postgres database. If you are using free Heroku Postgres, the DATABASE_URL env var will already be configured.
  1. Deploy and start chatting with Reminder Bot
  • Say "Hey RBot, status" in the group that you added the bot to

Getting Started for people who have no clue what they are doing

  1. Fork this repo
  • Click fork
  1. Create a free Heroku account and navigate to the dashboard
  • Click new -> create new app and name it whatever you want (reminder-bot-6000). Remember this name.
  • Click create app
  • Scroll down to Connect to GitHub
  • Select the repository you just forked (RBot)
  1. Go to the GroupMe Bots page (you may need to create an account) and click Create Bot.
  • Enter Reminder Bot as the Name
  • Enter https://i.groupme.com/1000x1000.png.46ad37818d924567985aa2e7f138f791 as the Avatar URL
  • If using Heroku, enter in the Callback URL as YOUR-APP-NAME.herokuapp.com/hook, replacing YOUR-APP-NAME with the name of the Heroku app you created in step 2 (reminder-bot-6000 for example).
  • If you are hosting somewhere other than Heroku, set the callback URL to the /hook route of your hosted site. For example, if your hosted domain is https://my-cool-bot.example.com, the callback URL would be https://my-cool-bot.example.com/hook
  1. In your Heroku app dashboard, navigate to Settings and click Reveal Config Vars
  • Enter BOT_ID as KEY and your GroupMe Bot ID (found on the GroupMe Bots page) in the VALUE section. Then click "Add."
  • Enter GROUP_ID with the Group Id associated with your bot
  1. Add-on Heroku Postgres Heroku Scheduler
  • For Heroku Postgres, go to the Resources tab of the app dashboard. Then, simply search for "Heroku Postgres" and select the Hobby Dev - Free option (no further configuration required)
  • For Heroku Scheduler, go back to the Resources tab and search for Heroku Scheduler. Click Submit Order Form.
    • Note: Heroku may require you to add a credit card to verify your identity. The card added should not be charged for the purposes of this app, but it unfortunately is a required step if you are hosting with heroku.
  • Click on the Heroku Scheduler in the list and it will open a new tab
  • Click Add Job and select Every 10 minutes. This will wake up our bot to check if it is time to send a message every 10 minutes.
  • In Run Command, type node cron-check.js and then press Save Job
  1. Start chatting with the Reminder Bot
  • In the group you added the bot to, try typing "Hey Reminder Bot, what is the status"
  • Ask the reminder bot "Hey RBot, what are the available commands?" for more

How it works

  • Each message sent in GroupMe is also sent to the bot
  • The bot has code written to parse the message and tell if you are talking to him
  • If you are talking to him, he will listen to you and update the database when you configure settings or enable the daily reminder
  • Heroku automatically puts the server to sleep when you haven't interacted with the bot for 30 minutes
  • Heroku will wake the bot up temporarily every 10 minutes to check if it is close to reminder time, and stay awake if it is close to time
  • The bot sends the message to GroupMe at the scheduled time

License

This code is licensed under GNU General Public License v3.0

rbot's People

Stargazers

 avatar

Watchers

Elijah Mock avatar

rbot's Issues

Option to use GroupMe ACCESS_TOKEN instead of BOT_ID

Enabling the user to input solely their access token would allow the app to configure the bot name, bot id, and bot avatar for them. This would also allow adding the bot to multiple groups and removing the bot from the group via messages.
The option to use BOT_ID and GROUP_ID instead could still be used.

Moderator of group

Allow a group member to be moderator and be the only one who can configure the Reminder Bot. This could reduce spam from other users. The command could be Rbot, take control and Rbot, release control

GUI setup

To reduce the setup process, a step-by-step /setup route could be created to input BOT_ID and GROUP_ID. This route could also be available after setup as a configuration GUI (in case a user doesn't want to chat with the bot directly in GroupMe).

Sufficient security measures would need to be taken to ensure not everyone can get to the /setup route, and to ensure that the BOT_ID and GROUP_ID tokens are safe. (Tokens could be encrypted into database.)

Add capitalization in messages

Currently, all messages are taken toLowerCase() and returned as query in recieveMessage. When setting the reminder message, though, capitalization should remain intact.
We must make sure that if we do not make query lowercase beforehand, we do that before passing to other functions (like setTimeOrDay).

Add timezone options

Server time cannot be used to schedule reminder times because the server may be in a different time zone. Currently, all reminder times are converted to Central time (frankly, because that is my time zone). Different timezone options should be implemented.

The command could be Hey RBot, change timezone to X and it would check if the timezone is valid and then store in database.
We then need to pull that info and use it in setCronAlarm.js

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.