LaunchBot keeps you up to date with what's going up, around the clock, since 2019. Reachable as @rocketrybot on Telegram.
LaunchBot uses the LaunchLibrary2 API to fetch launch information on intelligently scheduled intervals. The bot provides multiple forms of information: launch notifications, information about upcoming flights, and a simple flight schedule showing upcoming flights at a glance.
โจ Other features include...
- user-configurable notifications on...
- per-provider basis
- per-country basis
- user-choosable notification times from 4 different options
- mutable launches
- notifications of launches being postponed
- a quick, easily digestible message format
- direct links to launch webcasts
- automatically cleared notification messages
- neat statistics about the bot
- direct feedback to the developer via the bot
- spam management
- simple information refresh with Telegram's message buttons,
and tons of other things!
๐ Basic instructions
Install the Python3 dependencies with pip, using the requirements.txt file found in the repository: python3 -m pip install -R requirements.txt
.
After the dependencies are installed, you can run the bot with python3 launchbot.py -start
. For debugging purposes and running in the background with nohup, add -debug
: this prevents the flooding of the nohup.out
file.
๐ฅ Data structures
The bot creates the following supporting files under ../launchbot/
:
SQLite: launchbot-data.db
: houses all data the bot needs to operate, including launch caching, statistics, etc.
JSON: bot-settings.json
: used to configure the bot by setting the Telegram bot API key, alongside with some other configuration information.
You can specify your personal account's Telegram user ID in bot_settings.json in the form owner: "your_user_id"
. This disabled the logging of commands sent by you, and sends a notification for new feedback.
๐ Privacy
The bot stores every interaction (i.e. command) sent to it if logging is enabled, alongside with a truncated, unsalted SHA-1 hash of the user ID. No text messages are stored, aside from text sent as a reply to a feedback request message. The bot's privacy settings forbid the bot from reading regular text, as in text messages which have not tagged the bot (@botusername) or are not a reply to a message sent by the bot (these are not logged, unless they're a reply to a feedback message.)
Only information stored by the bot is the chat ID, which can also be the user ID of a user in the case of a private chat. This is the only user information stored, which is used to deliver notifications. If no notifications are enabled, no information is stored, aside from an in-memory chat ID for managing spam, which is automatically cleared when the program quits and is thus never stored.
Please note, that the above only applies on a per-bot basis. The creator of the bot chooses whether to configure the bot to be able to read all text messages, not just ones directed at the bot. Telegram bots are, by nature, extremely privacy invasive: don't add unknown bots to group chats, unless it's hosted by you or someone you trust.
- โ
implemented uncached API requests
- โ
implemented the request of next launch via a direct API call
- โ
implement /next using DB calls
- โ
implement support for SpaceX core information
- โ
add "next" and "previous" button(s) to /next command
- โ
add a mute button to notifications
- โ
update /notify to be more user friendly
- โ
implement /feedback
- โ
improve notification handling with the hold flag -> moving NETs and info text regarding them
- โ
change launch database index from tminus to net
- โ
Notify users of a launch being postponed if a notification has already been sent
- โ
disable logging of text messages; how to do feedback? (log feedback messages in a global array?)
- โ
add tbd-field to launches, so schedule can only show certain launch dates (filter certain and uncertain with a button)
- โ
add location (i.e. state/country) below pad information (Florida, USA etc.)
- โ
delete older notification messages when a new one is sent
- add a "more info"/"less info" button to /next and notification messages
- โ
add probability of launch and launch location, separate from mission name etc. with \n\n
- โ
allow users to set their own notifications (i.e. 24h/12h/...)
- โ
allow users to set their own timezone
- โ
upgrade to the LL2 API (LL1 closes at the end of October)
- โ
perform API requests intelligently, as the monthly request quota is enough for only one request every 8 minutes
- โ
don't update API on startup, unless it has been sufficiently long since last check: store requests in memory + storage
- โ
use schedule to schedule requests: just before a launch is due, plus for when notifications are supposed to be sent
- โ
a raw update schedule of once every 15 - 60 minutes
- โ
check for launch notifications intelligently
- โ
on API update, check for updated launch times (notification send times) -> clear schedule queue -> schedule next checks for when a notification is supposed to be sent
- โ
store LL2 and SpX API data in the same database
- โ
combine all separate database files into one file with multiple tables
- โ
attempt to split the monolithic file into multiple separate files, starting with the API request functions
- โ
index launches by the new unique launch ID instead of launch name
- โ
fully integrate new API and notifications systems with LaunchBot 1.5
- โ
complete pre_handler(), so we can update time zone information and get feedback
- โ
re-add statistics to all needed places
- add "show changelog" button under /statistics or /help
- load from a changelog.txt file?
- โ
open-source LaunchBot โจ
- โ
update from telepot Telegram API wrapper to python-telegram-bot
- identify bottlenecks in processing by benchmarking and timing functions
- the largest bottleneck is usually Telegram's API
- improve json-parsing performance by using multiprocessing
- use in-memory caching, like redis or memcached, to handle all responses
- reduce disk writes and reads: SD cards have terrible latency, LPDDR4 on RasPi is pretty snappy
- update cache on API call
- key:vals for all chats: simple, fast, easy
- enable the disabling of postpone notifications
- globally or on a per-launch basis