Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -299,11 +299,16 @@ async def on_message(message):
|
|
299 |
args = message.content.split()
|
300 |
del args[0]
|
301 |
if len(args) == 0:
|
302 |
-
|
303 |
-
f
|
304 |
-
|
305 |
-
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
307 |
if args[0] == "":
|
308 |
embed = discord.Embed(title="Error", description="Parameter `[channel]` empty. Use `--help` for command help.")
|
309 |
await message.reply(embed=embed)
|
@@ -318,7 +323,7 @@ async def on_message(message):
|
|
318 |
try:
|
319 |
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
320 |
f.write("")
|
321 |
-
embed = discord.Embed(title="Success", description=f"
|
322 |
await message.reply(embed=embed)
|
323 |
return 0
|
324 |
except:
|
|
|
299 |
args = message.content.split()
|
300 |
del args[0]
|
301 |
if len(args) == 0:
|
302 |
+
try:
|
303 |
+
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
304 |
+
f.write("")
|
305 |
+
embed = discord.Embed(title="Success", description=f"History reset in {args[0]}")
|
306 |
+
await message.reply(embed=embed)
|
307 |
+
return 0
|
308 |
+
except:
|
309 |
+
embed = discord.Embed(title="Error", description=f"No history in {args[0]}")
|
310 |
+
await message.reply(embed=embed)
|
311 |
+
return 0
|
312 |
if args[0] == "":
|
313 |
embed = discord.Embed(title="Error", description="Parameter `[channel]` empty. Use `--help` for command help.")
|
314 |
await message.reply(embed=embed)
|
|
|
323 |
try:
|
324 |
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
325 |
f.write("")
|
326 |
+
embed = discord.Embed(title="Success", description=f"History rest in {args[0]}")
|
327 |
await message.reply(embed=embed)
|
328 |
return 0
|
329 |
except:
|