An AI mood-tracking Discord bot powered by
DataStax Astra's Apache Cassandra Databases | Heroku CI/CD | Google Cloud
Domain.com | IBM Watson Tone Analyzer
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Pip is a Discord bot that aims to improve mental health through a multitude of functions. By combining IBM Watson’s tone analyzer and Google Cloud’s natural language processing sentiment, Pip can analyze messages and accurately determine the user's mood. Using the mood detected, Pip then responds accordingly, providing the user with support in the form of an uplifting message and the appropriate resources to help with how they are feeling. The user can also view their moods for the last 7 days in an easy-to-view graphic, which will help them identify things in their life that affect their mental well-being and make adjustments.
Alongside the mood tracking feature, Pip also offers a variety of other mental health services. Every 24 hours, Pip will send a message to give the user a mood boost and remind them to log their emotions. In case they feel down, Pip also has a motivation command that will automatically retrieve a motivational post from a never-ending list of options hand-curated by thousands of users. Finally, Pip can provide mental health resources on command if the user needs some more targeted resources.
- DataStax Astra Database
- Hosted on Heroku
- Google Cloud Translation/Natural Language Apis
- IBM Watson Tone Analyzer
To get a local copy up and running, follow these simple steps.
- Python
3.9
,pip3
-
Update before installing new packages
sudo apt-get update
-
Check Python version
python3 --version
-
If Python version <
3.9
sudo apt install python3.9
-
Validate
python3.9 --version
-
Install
pip3
sudo apt-get -y install python3-pip
-
Validate
pip3 --version
-
Clone the repo
git clone https://github.com/Ti1mmy/CheckinWithme.git
-
cd
into repo directorycd CheckinWithme
-
Install Prerequisite Libraries
pip3 install -r requirements.txt
-
Configure DataStaxAstra Cassandra Database
- Initialize CQL Database with keyspace
my_moods
- Click on Connect in the initialized database. Download and add
secure-connect-database-name.zip
to main directory.
- Initialize CQL Database with keyspace
-
Configure Google Cloud Services
- Create Service Account with
owner
role - Enable Cloud Translation API
- Enable Cloud Natural Language API
- Create Service Account with
-
-- DEPRECATED --
Add tokens toconfig/config.json
-
Bot tokens for Discord can be found in the Discord Developer Portal.
-
Copy tokens from DataStax Astra Database into
config/config.json
-
Download Google Cloud Key JSON to
/config/
-
Include path to Google Cloud JSON in
config.json
-
NEW: Only add
secure_connect_bundle
path intocongif/config.json
{ "_DataStax Astra Connect Bundle", "secure_connect_bundle": "./config/secure-connect-checkinwithme.zip", "_info": "Config system deprecated, add rest as environment variables!", "_Discord Bot": "Import Bot Tokens below if applicable", "token": "", "token_test": "", "_DataStacks Astra Keys_": "Import your DataStax Astra Keys below", "CLIENT_ID": "", "CLIENT_SECRET":"", "G_CLOUD_SERVICE_KEYFILE": "config/your-google-cloud-service-keyfile.json" }
-
-
-- DEPRECATED --
Add tokens for Reddit and IBM Watson Tone Analysis toconfig/reddit_keys.json
,config/watson.json
-
NEW - 18 January 2022: Add all keys to
PATH
instead!
- NB: If hosting on Heroku, use this buildpack.
export ASTRA_DB_APPLICATION_TOKEN=<token>;
export ASTRA_DB_ID=<Astra DB id>;
export ASTRA_DB_KEYSPACE=my_moods;
export ASTRA_DB_REGION=<region>;
export ASTRA_DB_SECRET=<secret>;
export DISCORD_SECRET=<discord bot token>;
export GOOGLE_APPLICATION_CREDENTIALS=google-credentials.json;
export GOOGLE_CREDENTIALS=<contents of json>;
export REDDIT_USER=<reddit username>;
export REDDIT_PASS=<reddit password>;
export REDDIT_APP=<APP id>;
export REDDIT_SECRET=<reddit secret>;
export WATSON_KEY=<ibm watson key>;
export WATSON_URL=<ibm watson url>
When Pip joins your server, it will create a read-only channel called #daily-check-in
. Every 24 hours, Pip will make an announcement reminding you to message it with a quick message on how your day is going so far.
Whenever you feel like logging how you feel, you can save an entry by messaging Pip using the >checkin
command! Type out your message after the >checkin
command for Pip to analyze and log how you feel.
- If you feel more comfortable expressing how you feel in your own language, Pip is completely able to understand your language as well as responding back using the same language!
- Pip logs your emotions throughout the day! You can let Pip know how you are feeling at any time, not just once per day!
- e.g.
>checkin Things have been going my way recently, I am grateful for my luck!
- par ex.
>checkin Les choses vont dans mon sens ces derniers temps, je suis reconnaissant pour ma chance!
- e.g.
Pip logs how you are feeling whenever you check in with it! You can view how you felt over the past seven days by viewing your >history
!
Rate:
- You can also let Pip know how you are feeling with the '
>rate
' command! Please include one of the following:| Anger | Fear | Joy | Sadness |
with the command. This provides a more direct and accurate method for our systems to track your mood.- For instance, you could type
>rate Sadness
to let Pip know you're feeling down at the moment.
- For instance, you could type
Motivation:
- Sends motivational messages to cheer you on to bigger and better.
Resource
- Generates a random resource to help you develop your mental health!
Optimizations:
- Replace long if-else trees with native switch-statements upon Python
3.10
release. - Move embeds from
bot.py
to a separate file.
Features:
- Voice Recognition in
>checkin
- Analyses .audio files that users record and send to bot
- Interactive Web UI to explore mood history in more depth
- Streak-detection
- Identifies streaks in good moods and compliments users
- Thoughts/Gratitude Journal Support
- Stores & Analyzes Journals, easily accessible on future Web UI
- Chatbot feature
- Allows users to casually converse with the b
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Eric Ji - Linkedin - [email protected]
Katherine Li Linkedin - [email protected]
Timothy Zheng - Linkedin - [email protected]
Yang Xu - Linkedin - [email protected]
Devpost Link: https://devpost.com/software/check-in-with-me
- Pip's avatar from Canva, use granted through Pro subscription
- MLH Mental Health Hacks
- Google Cloud Credits from Google
- DataStax Astra Credits by DataStax Astra