This commit is contained in:
insert 2024-05-15 17:51:00 -04:00
parent 7b19fa67e1
commit c831c15610
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -117,6 +117,19 @@ async def execute(inter: disnake.AppCmdInter, command:str):
response = "No Response" response = "No Response"
await inter.edit_original_response(content=f"Respose:\n```{response}```") await inter.edit_original_response(content=f"Respose:\n```{response}```")
@bot.slash_command(
name="list",
description="Lists the people on the server",
)
async def execute(inter: disnake.AppCmdInter):
await inter.response.defer()
with Client(os.getenv("RCON_IP"), int(os.getenv("RCON_PORT")), passwd=os.getenv("RCON_PASSWORD")) as client:
response = client.run("list")
if response == "":
response = "No Response"
await inter.edit_original_response(content=response)
@bot.slash_command( @bot.slash_command(
name="apply", name="apply",
description="Apply to join the server", description="Apply to join the server",
@ -164,7 +177,7 @@ async def button_listener(inter: disnake.MessageInteraction):
whitelistedrole = guild.get_role(int(os.getenv("WHITELISTED_ROLE_ID"))) whitelistedrole = guild.get_role(int(os.getenv("WHITELISTED_ROLE_ID")))
member = await guild.fetch_member(inter.user.id) member = await guild.fetch_member(inter.user.id)
if any(r in member.roles for r in (approle, whitelistedrole)): if any(r in member.roles for r in (approle, whitelistedrole)):
await inter.response.send_message("You have already applied, you many not apply again!", ephemeral=True) await inter.response.send_message("You have already applied, you may not apply again!", ephemeral=True)
else: else:
await inter.response.send_modal(modal=ApplicationModal()) await inter.response.send_modal(modal=ApplicationModal())
return return