Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -89,6 +89,18 @@ async def show_xp_data(ctx):
|
|
89 |
await ctx.send('You have not earned any XP yet.')
|
90 |
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
|
94 |
|
|
|
89 |
await ctx.send('You have not earned any XP yet.')
|
90 |
|
91 |
|
92 |
+
@bot.command()
|
93 |
+
async def load_xp(ctx):
|
94 |
+
try:
|
95 |
+
xp_data.clear() # Clear current XP data
|
96 |
+
with open('xp_data.json', 'r') as f:
|
97 |
+
loaded_data = json.load(f)
|
98 |
+
xp_data.update(loaded_data) # Update with loaded data
|
99 |
+
await ctx.send('XP data has been loaded from the file.')
|
100 |
+
except FileNotFoundError:
|
101 |
+
await ctx.send('No XP data file found.')
|
102 |
+
|
103 |
+
|
104 |
|
105 |
|
106 |
|