Skip to content

Telegram bot to track space launches and other space related events using the Launch Library 2 API.

License

Notifications You must be signed in to change notification settings

Charly98cma/Nextflight-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nextflight_bot

Basic info

Hey there :D

I've made this bot to solve a problem I only had, but, hey, maybe someone else have it too, thats why I decided to make it public.

This is a pretty basic bot with the following commands:

  • /start - Starts the conversation with the bot and this one ask for your location (only used to give dates and times according to your timezone)
  • /help - Gives the list of commands and a brief explanation
  • /nextflight - Answers with the info of the next space flight (name, dates, description, location, etc..) and photo of the rocket or the infographic if it's available.
  • /nextevent - Shows information about the next space related event (EVAs, Dock/Undock of capsules on the ISS, Press releases, etc...)
  • /cancel - End the conversation with the bot

The bot lets you restart the conversation at any point if you want to change the timezone.

The very basics are mostly done, but I want to implement Events too (ISS dock/undock of capsules, EVA, etc...) and more ideas I have in mind (dates and times on user TZ, translation of texts and messages, etc...)

See the TODO section to see the roadmap of this project and it's current state.

Hope you like it and it's helpful to someone else ;)

If you want to give it a taste, once it's hosted, he's waiting you here.

Dependencies and execution

Docker installation

There's a Dockerfile that will deploy the bot and all its dependencies on a container, making it easier to deploy and manage.

First of all, you'll need a token, see Credentials for more information.

Now, you must create the docker image:

docker build --tag nextflight-bot .

Now, you only have to run the image:

docker run --detach --name nextflight-bot nextflight-bot:latest

And that's all! Very easy and very fast!

Manual installation

First of all, make sure your system has already installed Python 3 (please, stop using Python 2 😄 ) and pip.

If you don't know how to do it, this article contains the commands to install it Python 3 and pip on Windows, MAC, Linux (commands for each package manager) and Raspberry Pi.

This bot uses a couple of packages which are available on pip, see requirements.txt to see all of them.

The installation process of all the required packages has been changed to even more simple commands using the next command:

make init

And... you're almost ready to take off :P

To run the bot, just execute:

make run

Credentials

To create yout bot, you must talk to the BotFather, which will guide you through the basics of setting up your bot, and will give you the token.

Once everything is set up, you have to create a new environment variable called NF_TOKEN with your token, which can be done executing the next command:

make token

Acknowledgements

Thanks to the original developer of Launch Library, the original API, and the awesome developers of The Space Devs for improving the project and making Launch Library 2.


TODO

  • Change description, commands and about me on BotFather
  • Release first stable version
  • Dates and times in user timezone, not in UTC using user location.
  • Bugs, fixes and typos
  • New /cancel command
  • Create dev branch and keep master as Stable version.
  • Move messages out of the main code
  • Add GPL License
  • Restructure the project to make it "professional" (unload the only .py file)
  • Deploy bot on VPS
  • Fix installation process (dependencies)
  • Fix /cancel bug (doesn't let restart the conversation)
  • Events (dock/undock of capsules, EVAs, etc...)
  • Fix make token that doesn't read the token.txt file
  • Make a docker image for easy deployment
  • Release second stable version