Skip to content

Commit 9380a85

Browse files
author
memegauste
committed
Urgh
1 parent 8a7797b commit 9380a85

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

misc/SerialCord/main.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ async def get_home_ip(interaction):
4747
'❌ Błędna konfiguracja serwera, nie jesteś administratorem!',
4848
ephemeral=True,
4949
)
50-
elif interaction.user.id != config.get('owner_bot_id'):
50+
if interaction.user.id != config.get('owner_bot_id'):
5151
return await interaction.response.send_message(
5252
'❌ Ta komenda jest tylko dla właściciela bota.',
5353
ephemeral=True,
5454
)
5555

56+
# odroczenie odpowiedzi
57+
await interaction.response.defer(ephemeral=True)
58+
5659
try:
5760
async with aiohttp.ClientSession() as session:
5861
async with session.get('https://api.ipify.org') as r:
@@ -63,14 +66,20 @@ async def get_home_ip(interaction):
6366
ephemeral=True,
6467
)
6568

69+
await interaction.followup.send(
70+
'📨 IP zostało wysłane w prywatnej wiadomości.',
71+
ephemeral=True,
72+
)
73+
6674
try:
75+
await interaction.user.send(
76+
f"Publiczny adres piwnicy w Gutkowie to {public_ip}"
77+
)
78+
except:
6779
await interaction.followup.send(
68-
'Zwrócono adres IP w prywatnej wiadomości.',
69-
ephemeral=True,
80+
"❌ Nie udało się wysłać wiadomości prywatnej.",
81+
ephemeral=True
7082
)
71-
await interaction.user.send(f"Publiczny adres piwnicy w Gutkowie to {public_ip}")
72-
except Exception as e:
73-
pass
7483

7584
@tree.command(description='Kenify input to SerialCord')
7685
async def kenify(interaction, msg: str):

0 commit comments

Comments
 (0)