The Reminder Bot is a Python script that fetches reminders from a MySQL database, sends them as SMS messages using the Twilio API, and updates the database to indicate that the messages have been sent.
The script operates with three columns: number, message, and called. Whenever it makes a query, it selects an entry and sends the text from the message column to the number in the number column. If this operation is successful, it sets the called column in the row to 0, which ensures that the row will not be displayed in the next query.
-
Clone or download this repository.
-
Install the required packages by running the following command:
pip install -r requirements.txt
- Create a
einst.py
file with your Twilio, MySQL, and email credentials.
To use the Reminder Bot, run the following command:
python reminder_bot.py
The script will run indefinitely, checking the database for reminders once per day. If it encounters an error, it will log the error to a log file and continue running.
The einst.py
file contains the following configuration parameters:
tw_account_sid
: Your Twilio account SID.tw_auth_token
: Your Twilio authentication token.tw_url
: The URL of the Twilio XML file to use for outgoing calls.tw_to
: The phone number to send reminders to.tw_from
: Your Twilio phone number.tw_messaging_service_sid
: The messaging service SID to use for outgoing messages.
db_host
: The host name of your MySQL database.db_user
: The MySQL user name to use.db_password
: The MySQL password to use.db_name
: The name of the MySQL database to use.
e_sender_email
: The email address of the sender.e_receiver_email
: The email address of the recipient.e_password
: The password for the sender's email account.