A bot for STAC's Discord server. It can do the following :
@STACBot help
: replies with this help message.@STACBot ping
: Measure the delay for the bot to receive messages.@STACBot react [n:int,1+]
: Reacts to nth message in history with 'π€©', 'π₯', 'π', 'π―'. Default value of n is 1.@STACBot poll <n:int,1+>
: starts a poll by reacting to n last messages with 'π' and 'π'.@STACBot events [month:1..12] [year:2002+]
: Get a list of astronomical events happening this month, or in the past@STACBot (image|photo) [k:int,0+]
: Display an astronomy-related photo of the day (for today, or k days ago); or;
@STACBot (image|photo) search <subject> [ show <n:1..10> ]
Display upto n (default 1) images of an astronomical object.
This bot automatically reacts with 'π€©', 'π₯', 'π', 'π―' to attached images and if there is a link in a message. It also posts the upcoming events on the first day of each month in the dedicated channel. A limited number of recent messages are also cached in RAM to make it faster and avoid unnecessary network requests.
- Make a discord bot using https://discord.com/developers.
- Clone this repository.
- make virtual environment by using
python3 -m virtualenv venv
in this directory. - activate venv using
source venv/bin/activate
. You are now in your virtual environment. - Install requirements using
pip3 install -r requierments.txt
. - Export all the required environment variables or save them to a
.env
file at the repo root. - Run the bot using
python3 bot.py
. - Hurrey! π₯³ Your bot is working. Send a help message to your bot, like
@MY_BOT_NAME help
.
- Astronomical event data is sourced from the calendars at skymaps.com/articles.
- Photographs displayed are from Astrobin's API. This bot is not endorsed or certified by AstroBin.
- Details of the exact article/photo are mentioned in the messages.