|
@@ -40,9 +40,12 @@ async def carbon_func(_, message):
|
|
|
return await message.reply_text(
|
|
return await message.reply_text(
|
|
|
"Reply to a text message to make carbon."
|
|
"Reply to a text message to make carbon."
|
|
|
)
|
|
)
|
|
|
- m = await message.reply_text("Preparing Carbon")
|
|
|
|
|
- carbon = await make_carbon(message.reply_to_message.text)
|
|
|
|
|
- await m.edit("Uploading")
|
|
|
|
|
- await app.send_document(message.chat.id, carbon)
|
|
|
|
|
- await m.delete()
|
|
|
|
|
- carbon.close()
|
|
|
|
|
|
|
+ status = await message.reply_text("Preparing Carbon…")
|
|
|
|
|
+ try:
|
|
|
|
|
+ carbon = await make_carbon(message.reply_to_message.text)
|
|
|
|
|
+ await status.edit("Uploading…")
|
|
|
|
|
+ await app.send_document(message.chat.id, carbon)
|
|
|
|
|
+ except Exception as e:
|
|
|
|
|
+ await status.edit(f"❌ Failed: {e}")
|
|
|
|
|
+ else:
|
|
|
|
|
+ await status.delete()
|