Spaces:
Building
Building
Update database.py
Browse files- database.py +10 -3
database.py
CHANGED
@@ -7,7 +7,14 @@ async def database(interaction: discord.Interaction):
|
|
7 |
save_database()
|
8 |
|
9 |
try:
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
except FileNotFoundError:
|
13 |
-
await interaction.response.send_message("
|
|
|
7 |
save_database()
|
8 |
|
9 |
try:
|
10 |
+
with open("database.txt", "r") as f:
|
11 |
+
content = f.read().strip()
|
12 |
+
|
13 |
+
if content:
|
14 |
+
formatted_content = "\n".join(content.split("\n"))
|
15 |
+
|
16 |
+
await interaction.response.send_message(f" database:\n```\n{formatted_content}\n```")
|
17 |
+
else:
|
18 |
+
await interaction.response.send_message("The database is empty.")
|
19 |
except FileNotFoundError:
|
20 |
+
await interaction.response.send_message("l.")
|