Back
Discord Bots

Deploy a Python Discord bot

Run a discord.py / Pycord / Nextcord bot on Victus: upload or clone your code, set the entry file and requirements, add your token, and go live.

pythondiscord.pypycordnextcorddeploybot

Python bots run on a Python egg on the Victus panel. It works just like the Node.js flow — Console, Files, Startup, power controls — but it launches python <file> and installs a requirements.txt instead of package.json. This works for discord.py, Pycord, Nextcord, disnake and hikari. You will need a bot token from the Discord Developer Portal, your code (Git or ready to upload) with a requirements.txt, and a bot plan ordered from billing.victuscloud.com.

Step 1 — Load your code

  1. 1Git: set the repository address (and branch) in the Startup tab so the egg clones it on start; enable auto-update to pull on every restart.
  2. 2Upload: use the Files tab to drag your project in, or upload a .zip and Unarchive it. Keep main.py / bot.py and requirements.txt in the server root.

Step 2 — Add a requirements.txt

text
discord.py==2.3.2
python-dotenv==1.0.1
aiohttp==3.9.5

Do not upload a venv

Never upload a local virtual environment (venv/ or __pycache__). It is tied to your machine and will break on the server. Upload only source + requirements.txt and let Victus install cleanly with pip on start.

Step 3 — Set the entry file and read the token

In the Startup tab, set the app/py-file variable to your entry point (commonly main.py or bot.py). The egg then effectively runs pip install -r requirements.txt && python main.py. Read the token from the environment rather than hardcoding it.

python
import os
import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.message_content = True  # requires the Message Content Intent in the portal

bot = commands.Bot(command_prefix="!", intents=intents)

@bot.event
async def on_ready():
    print(f"Logged in as {bot.user}")

bot.run(os.environ["DISCORD_TOKEN"])

Match the Python version

discord.py 2.x needs Python 3.8+ and modern libraries often want 3.11+. If the egg lets you pick a Python/Docker image in the Startup tab, choose a version that satisfies your dependencies, then reinstall. If it crashes on login with an intents error, enable the privileged intents in the Developer Portal.