A Telegram bot which you can use to get information on gravitational wave events from LIGO/Virgo.
Add the bot by searching for GraceDbBot on Telegram or click here. Bot is down and project is archived. To host it yourself see below
Currently the bot responds to the following commands:
Shows a welcome message and an overview of all possible commands.
Shows the latest measured event.
Select an event where you want to see the details of.
Shows an overview of all measured events during observational run 3.
Shows the current status of all three detectors.
After subscribing you will automatically receive a message when a new event was measured or an existing event was updated or retraced.
If you want to host the bot yourself, you can install it as follows.
-
Clone this repo
git@github.com:Roald87/GraceDB.git
-
Create a new virtual environment with pip or conda
conda create -n gracebot python=3.7 conda activate gracebot # not all package are available for installation via conda pip install -r ~/path/to/gracebot/requirements.txt
# Install venv to create virtual environments python3 -m pip install --user venv # Create a new virtual environment python3 -m venv gracebot # Activate the virtual environment you just created source gracebot/bin/activate # Install required packages pip install -r ~/path/to/gracebot/requirements.txt
-
Create a new telegram bot via the instructions here.
-
Create a new file
/path/to/gracebot/gracebot/config.py
. -
Add the following five variables to
config.py
. ForAPI_TOKEN
use the token you were given when you registered the new bot. Do not share this api token or any of the other variables in this file with anyone, since it can be used to control your bot. Thensecret
,preliminary_command
,update_command
andretraction_command
should be hard to guess randomized strings. You can generate these yourself. They are used to trigger bot commands.API_TOKEN = '110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw' secret = '2eh4y5gqfliqoy2t' preliminary_command = 'fjsapdofih9328fhjdsa' update_command = 'adsfj933092hpajsvbdfa32' retraction_command = 'q23tgrgaqgn3ooq3g'
-
Download ngrok and register an account to expose gracebot to the internet.
-
Create a file
/path/to/ngrok/config.yml
and add your authtoken to the config fileauthtoken: dfasj8oiafh3fsadjfhsdjfha tunnels: default: proto: http addr: 8080
-
Start the ngrok tunnel
cd ~; nohup ngrok/ngrok start --all --config="ngrok/config.yml" &
-
Start gracebot and the listener which listens for new events
# Activate the virtual environment source ~/path/to/venvs/gracedb/bin/activate printf 'Starting GraceBot.' cd ~/path/to/gracebot/ nohup python3 gracebot/main.py > gracebot.out 2>&1& sleep 3 printf 'Starting GCN listener.' nohup python gracebot/listener.py > listener.out 2>&1&
I'm not an expert on gravitational waves. So if you see something which doesn't make sense, please let me know.