Changed host parameters for webpage

This commit is contained in:
2026-01-28 12:41:58 -05:00
parent d960f6aa15
commit b5a4d84368
3 changed files with 22 additions and 7 deletions

10
main.py
View File

@@ -100,9 +100,15 @@ async def start_bot():
async def main():
# Parse command-line arguments
import argparse
import os
# Read from environment variables first, then fall back to defaults
default_port = int(os.getenv("PORT", "8000"))
default_host = os.getenv("HOST", "127.0.0.1")
parser = argparse.ArgumentParser(description="Faction War Dispatch Bot")
parser.add_argument("--port", type=int, default=8000, help="Port to run the application on (default: 8000)")
parser.add_argument("--host", type=str, default="127.0.0.1", help="Host to bind to (default: 127.0.0.1)")
parser.add_argument("--port", type=int, default=default_port, help=f"Port to run the application on (default: {default_port})")
parser.add_argument("--host", type=str, default=default_host, help=f"Host to bind to (default: {default_host})")
args = parser.parse_args()
# Start Discord bot in background