bot: Add private ip to new worker command
This commit is contained in:
parent
f54d805371
commit
dbbb60cab8
@ -21,9 +21,9 @@ client = discord.Client(intents=intents)
|
|||||||
tree = app_commands.CommandTree(client)
|
tree = app_commands.CommandTree(client)
|
||||||
|
|
||||||
@tree.command(name="addworker", description="Adds a worker to the master server")
|
@tree.command(name="addworker", description="Adds a worker to the master server")
|
||||||
async def addworker(ctx, ip: str, name: str):
|
async def addworker(ctx, ip: str,privateip: str, name: str):
|
||||||
if ctx.user.id == ADMINID:
|
if ctx.user.id == ADMINID:
|
||||||
r = requests.post(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}&priv={privateip}",headers={"key":os.getenv('WORKER_KEY')})
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
await ctx.response.send_message(f"Worker {name} added to the master server",ephemeral=True)
|
await ctx.response.send_message(f"Worker {name} added to the master server",ephemeral=True)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user