bot: Fixed add worker api request
All checks were successful
Build Docker / Build Master (push) Successful in 20s
Build Docker / Build Bot (push) Successful in 24s

This commit is contained in:
Nathan Woodburn 2023-08-24 13:59:08 +10:00
parent b95af98c74
commit fec6c64736
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -23,7 +23,7 @@ tree = app_commands.CommandTree(client)
@tree.command(name="addworker", description="Adds a worker to the master server")
async def addworker(ctx, ip: str, name: str):
if ctx.user.id == ADMINID:
r = requests.get(f"http://{Master_IP}:{Master_Port}/add-worker?worker={name}&ip={ip}",headers={"key":os.getenv('WORKER_KEY')})
r = requests.post(f"http://{Master_IP}:{Master_Port}/add-worker?worker={name}&ip={ip}",headers={"key":os.getenv('WORKER_KEY')})
if r.status_code == 200:
await ctx.response.send_message(f"Worker {name} added to the master server",ephemeral=True)
else: