Changed host parameters for webpage
This commit is contained in:
10
main.py
10
main.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user