coollsd commited on
Commit
668d7e6
·
verified ·
1 Parent(s): c320780

Update database.py

Browse files
Files changed (1) hide show
  1. database.py +5 -7
database.py CHANGED
@@ -6,10 +6,8 @@ from cash import user_cash, save_database
6
  async def database(interaction: discord.Interaction):
7
  save_database()
8
 
9
- with open("database.txt", "r") as f:
10
- content = f.read()
11
-
12
- if content:
13
- await interaction.response.send_message(f"database :\n```\n{content}\n```")
14
- else:
15
- await interaction.response.send_message("The database is empty.")
 
6
  async def database(interaction: discord.Interaction):
7
  save_database()
8
 
9
+ try:
10
+ file = discord.File("database.txt", filename="database.txt")
11
+ await interaction.response.send_message("database:", file=file)
12
+ except FileNotFoundError:
13
+ await interaction.response.send_message("data EMPTY.")