Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -48,6 +48,15 @@ def has_code_entity(message):
|
|
48 |
return True
|
49 |
return False
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
@bot.on_callback_query(filters.regex(r"^unwarn_(\d+)_(-?\d+)$"))
|
52 |
async def unwarn_button(client, callback_query):
|
53 |
user_id = int(callback_query.matches[0].group(1))
|
@@ -747,6 +756,7 @@ async def evaluation_cmd(client, message):
|
|
747 |
|
748 |
final_output = f"**OUTPUT**:\n<pre language=''>{evaluation.strip()}</pre>"
|
749 |
if len(final_output) > 4096:
|
|
|
750 |
with open("eval.txt", "w+", encoding="utf8") as out_file:
|
751 |
out_file.write(final_output)
|
752 |
await status_message.reply_document(
|
@@ -756,8 +766,11 @@ async def evaluation_cmd(client, message):
|
|
756 |
[
|
757 |
[
|
758 |
InlineKeyboardButton(
|
759 |
-
"Pastebin", url=f"{
|
760 |
-
)
|
|
|
|
|
|
|
761 |
]
|
762 |
]
|
763 |
),
|
|
|
48 |
return True
|
49 |
return False
|
50 |
|
51 |
+
@bot.on_callback_query(filters.regex(r"^deletepaste_(\w+)$"))
|
52 |
+
async def deletepastecb(client, cb):
|
53 |
+
paste_id = cb.matches[0].group(1)
|
54 |
+
user_id = cb.from_user.id
|
55 |
+
if user_id != 6477856957:
|
56 |
+
return await cb.answer("❌ Hanya developer", show_alert=True)
|
57 |
+
await delete_paste(paste_id)
|
58 |
+
await cb.message.edit_text(f"✅ Paste ID telah dihapus.")
|
59 |
+
|
60 |
@bot.on_callback_query(filters.regex(r"^unwarn_(\d+)_(-?\d+)$"))
|
61 |
async def unwarn_button(client, callback_query):
|
62 |
user_id = int(callback_query.matches[0].group(1))
|
|
|
756 |
|
757 |
final_output = f"**OUTPUT**:\n<pre language=''>{evaluation.strip()}</pre>"
|
758 |
if len(final_output) > 4096:
|
759 |
+
urls = await paste_text(evaluation.strip())
|
760 |
with open("eval.txt", "w+", encoding="utf8") as out_file:
|
761 |
out_file.write(final_output)
|
762 |
await status_message.reply_document(
|
|
|
766 |
[
|
767 |
[
|
768 |
InlineKeyboardButton(
|
769 |
+
"Pastebin", url=f"{urls}"
|
770 |
+
),
|
771 |
+
InlineKeyboardButton(
|
772 |
+
"Delete Pastebin", callback_data=f"deletepaste_{urls.split()[3]}"
|
773 |
+
),
|
774 |
]
|
775 |
]
|
776 |
),
|