This guide is for bots written in Python, for example with discord.py.
Switch the server to Python
A new bot server starts as a Node.js server. Change it before you upload anything, because changing the type reinstalls the server and by default deletes its files.
- Open your server in the panel and stay on Overview.
- Click Edit Server Type and choose Python Bot, then follow the steps. See How to change your server type or game version if you want the full walkthrough.
Add your bot
Open Files and upload your bot, including
requirements.txtif you have one.- Using git instead? Open Settings, then Game Settings and fill in Git repository. For a private repository also set the git username and an access token.
- In Game Settings, set Main file to the file that starts your bot, such as
bot.pyormain.py. - Check Requirements file. The default is
requirements.txt. When that file exists, its packages are installed on every start. - Paste your token into Discord bot token (optional). Your code reads it with
os.environ["DISCORD_TOKEN"].





