This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16aea53
commit 328af48
Showing
1 changed file
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,12 @@ There are more features I want to provide to users to make this bot better. | |
|
||
- The ability to customize metrics and notifications without having to host your own bot | ||
- A /baseline command that you can define as a shorthand for e.g. neutral mood and eight hours of sleep to make | ||
tracking even more easy | ||
tracking even more easy | ||
- Customized, more powerful visualization features | ||
|
||
# Running | ||
|
||
## Quickstart | ||
## Quickstart | ||
|
||
I host the Docker image for this application on a public ECR repository. All you have to do is to create your own | ||
Telegram via the [Botfather](https://t.me/botfather) and supply it to the container as an environment variable: | ||
|
@@ -59,4 +59,61 @@ Metrics have to map to numbers under the hood for purposes of visualization and | |
These will show up as [Inline Buttons](https://core.telegram.org/bots/2-0-intro#switch-to-inline-buttons) when recording | ||
your mood, with the labels showing up as "Highly Anxious", "Somewhat Anxious" and "Calm". | ||
# Developing | ||
### Using Emojis | ||
If you want to be cute, you can configure the above metric with emojis as well. Simply set the proper flag and | ||
specify emoji codes that can be mapped internally: | ||
```yaml | ||
metrics: | ||
- name: anxiety | ||
user_prompt: "What are your anxiety levels like right now?" | ||
values: | ||
":face_screaming_in_fear:": 2 | ||
":fearful_face:": 1 | ||
":face_without_mouth:": 0 | ||
``` | ||
If you want to find emojis, I suggest doing so on the official webpage of the | ||
[Unicode Consortium](https://unicode.org/emoji/charts/full-emoji-list.html). Generally, you can take the name like | ||
"downcast face with sweat" and turn it into snakecase ("downcast_face_with_sweat") and put it into `emoji.emojize()` | ||
to see if it will work or not. | ||
|
||
### Strictly Numerical Metrics | ||
|
||
There are metrics that are entirely numerical in nature. Let's say you want to track the amount of hours you sleep. | ||
In this case, the labels would be exactly equal to their values ("8" would just map to the value 8). | ||
|
||
For this case, I've added a metric type called `numeric`. You can declare `numeric` metrics like this: | ||
|
||
```yaml | ||
- name: sleep | ||
user_prompt: "How much sleep did you get today?" | ||
type: numeric | ||
values: | ||
lower_bound: 4 | ||
upper_bound: 12 | ||
``` | ||
|
||
This will auto-generate the corresponding dictionary for you, without you having to painstakingly type out every | ||
possible value. | ||
|
||
# Developing | ||
|
||
If you'd like to contribute to this repository, feel free to raise a PR. | ||
You'll have to have Poetry and Python 3.11 installed. | ||
You can clone the repo and set up your own poetry environment: | ||
|
||
```shell | ||
git clone [email protected]:twaslowski/telegram-mood-tracker.git && cd telegram-mood-tracker | ||
poetry env use 3.11.6 # or another patch version | ||
poetry install --with dev | ||
make test | ||
``` | ||
|
||
I encourage the use of pre-commit hooks. You can enable them by running | ||
|
||
```shell | ||
pre-commit install | ||
pre-commit run --all-files --verbose | ||
``` |