There are two methods to deploy your bot to the internet so that everyone can use it.
Before using any method, you need to ensure that:
- You have a
requirements.txtfile which includes all the additional requirements which you might have installed while coding up the logic for your bot and it also contains the
- The name of the file in which the
on_messagefunction is present is named
- You can have your own packages and modules in different folders and have relative imports to them. But the
requirements.txtmust ABSOLUTELY NOT be in any folder of their own. Do take a look at the folder structures below for better understanding.
- Archive these two (or more) files into a
.ziparchive. It's important that it's a .zip archive and not anything else.
- You can archive it yourself but we recommend you use the compress command available from the CLI.
- If you wish to do this by yourself and you are using MacOS, please read the note below.
Important note for MacOS users
Please download the software
RAR Extractor MAX from App Store
for creating archives as MacOS creates an extra
__MACOSX folder when compressing using the native compress utility which causes some issues with our backend.
When you decide to archive the files, please MAKE SURE that main.py and requirements.txt are available in the root of the archive itself. As in if the zip is extracted, it will produce two (or more) files/folders.
Good folder structure ✅
Bad folder structure 1 ❌
Bad folder structure 2 ❌
│ ├── main.py
│ └── requirements.txt