bot: Only let bot owner view all domains
This commit is contained in:
parent
1c74df2cc2
commit
bb8049ad63
6
bot.py
6
bot.py
@ -67,9 +67,9 @@ async def delete(interaction, handshakedomain: str):
|
|||||||
@tree.command(name = "list", description = "List all Handshake mirrors")
|
@tree.command(name = "list", description = "List all Handshake mirrors")
|
||||||
async def list(interaction):
|
async def list(interaction):
|
||||||
print("Listing mirrors...")
|
print("Listing mirrors...")
|
||||||
# Get user from interaction
|
# Verify user is bot owner
|
||||||
user = interaction.user
|
user = interaction.user
|
||||||
if user.id != 892672018917519370:
|
if user != interaction.client.application.owner:
|
||||||
await interaction.response.send_message("You don't have permission to do that.", ephemeral=True)
|
await interaction.response.send_message("You don't have permission to do that.", ephemeral=True)
|
||||||
print(user + " tried to list mirrors.")
|
print(user + " tried to list mirrors.")
|
||||||
return
|
return
|
||||||
@ -78,7 +78,7 @@ async def list(interaction):
|
|||||||
files = os.listdir("/etc/nginx/sites-available")
|
files = os.listdir("/etc/nginx/sites-available")
|
||||||
# Remove default
|
# Remove default
|
||||||
files.remove("default")
|
files.remove("default")
|
||||||
await interaction.response.send_message("Here are all the mirrors:\n" + "\n".join(files))
|
await interaction.response.send_message("Here are all the mirrors:\n" + "\n".join(files), ephemeral=True)
|
||||||
|
|
||||||
@tree.command(name = "tlsa", description = "Get the TLSA record for an existing Handshake domain")
|
@tree.command(name = "tlsa", description = "Get the TLSA record for an existing Handshake domain")
|
||||||
async def tlsa(interaction, handshakedomain: str):
|
async def tlsa(interaction, handshakedomain: str):
|
||||||
|
Loading…
Reference in New Issue
Block a user