Basic Proxmox + Discord bot template
Project description
proxmox-discord-connector
Python Discord bot template that queries Proxmox via slash commands.
The codebase now follows an object-oriented structure:
ProxmoxDiscordApplicationhandles app startup.ProxmoxDiscordBotsubclassescommands.Botand registers cogs insetup_hook.NodesCogandRandomMessageCogencapsulate slash command behavior.ProxmoxServiceencapsulates Proxmox API client access.
Requirements
- Python 3.11+
Setup
python -m venv .venv
cp .env.example .env
Activate the virtual environment:
# bash/zsh
source .venv/bin/activate
# fish
source .venv/bin/activate.fish
Install the project from the repository root (not src/):
python -m pip install -e .
Edit .env with your values.
DISCORD_BOT_TOKEN, PROXMOX_HOST, PROXMOX_USER, and PROXMOX_PASSWORD are required.
DISCORD_ALLOWED_USER_IDS is optional (comma-separated Discord user IDs).
DISCORD_SYNC_GUILD_ID is optional and recommended for development to get near-instant slash command updates.
PROXMOX_VERIFY_SSL defaults to true.
Environment variables
DISCORD_BOT_TOKEN: Discord bot token.DISCORD_ALLOWED_USER_IDS: Optional comma-separated allowlist for restricted commands (e.g.123,456).DISCORD_SYNC_GUILD_ID: Optional Discord server ID for development command sync (fast propagation).PROXMOX_HOST: Proxmox host or IP.PROXMOX_USER: Proxmox user (for exampleroot@pam).PROXMOX_PASSWORD: Proxmox password.PROXMOX_VERIFY_SSL:trueorfalse(defaults totrue).
Slash Command Sync Speed
Discord global slash command propagation can take a while.
For fast development updates, set DISCORD_SYNC_GUILD_ID to your server ID in .env.
Example:
DISCORD_SYNC_GUILD_ID=123456789012345678
When this is set, the bot copies global commands to that guild and syncs there on startup, so new commands usually appear quickly after restart.
Run
python -m proxmox_discord_connector.main
If activation is not working in your shell, run directly with the venv Python:
.venv/bin/python -m pip install -e .
.venv/bin/python -m proxmox_discord_connector.main
Slash commands
/nodes- List Proxmox nodes. HonorsDISCORD_ALLOWED_USER_IDSwhen provided./lxcs- List Proxmox LXC containers. HonorsDISCORD_ALLOWED_USER_IDSwhen provided./randommsg- Return a random greeting.
Project structure
src/proxmox_discord_connector/
app.py # Application entry object
bot.py # Bot subclass and setup_hook
config.py # Environment-backed settings
main.py # Executable module entrypoint
services/
proxmox_service.py # Proxmox API service layer
slash_commands/
nodes.py # NodesCog
randommsg.py # RandomMessageCog
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proxmox_discord_connector-0.1.0.tar.gz.
File metadata
- Download URL: proxmox_discord_connector-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f80926af30834b4d6d1c27718009f05778ae8dea11529923bd9553a345fb41d6
|
|
| MD5 |
34abbf68baf64161ab8721c905bf3f53
|
|
| BLAKE2b-256 |
9943f6fac4c62ffb8a0471a464241c9001c4ed977eeb7bae7d88e2b091d88703
|
File details
Details for the file proxmox_discord_connector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: proxmox_discord_connector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e59666208e1facd4efb129a810e8a36b96519e5a86e0a57f2bb270db4902e41
|
|
| MD5 |
65a587715281f4f330b3c1653b3d9f59
|
|
| BLAKE2b-256 |
50c17a397179aa1e06409f810d8dc9e6dea32333a2a375765cc58a47765af29c
|