Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -133,6 +133,25 @@ async def unban_button(client, callback_query):
|
|
133 |
except Exception as e:
|
134 |
await callback_query.message.reply_text(f"Gagal menghapus larangan: {e}")
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
@bot.on_message(filters.command("start") & filters.private)
|
137 |
async def start_command(client, message):
|
138 |
reply_markup = InlineKeyboardMarkup( # type: ignore
|
|
|
133 |
except Exception as e:
|
134 |
await callback_query.message.reply_text(f"Gagal menghapus larangan: {e}")
|
135 |
|
136 |
+
@bot.on_message(filters.command("delwarn") & filters.group)
|
137 |
+
async def delwarn(client, message):
|
138 |
+
if message.from_user.id not in [6477856957]:
|
139 |
+
return await message.reply_text("LU SIAPA? GAK ADA IZIN GUE!")
|
140 |
+
if len(message.command) != 2:
|
141 |
+
return await message.reply_text("GAK ADA USER ID NYA? GIMANA NARIK BOT KE GRUP LU?")
|
142 |
+
user_id = int(message.command[1])
|
143 |
+
try:
|
144 |
+
await db.warns.delete_one({"chat_id": message.chat.id, "user_id": user_id})
|
145 |
+
await message.reply_text(
|
146 |
+
"berhasil menghapus semua peringatan"
|
147 |
+
)
|
148 |
+
return
|
149 |
+
except Exception as e:
|
150 |
+
logging.error(f"Error removing all warnings: {e}")
|
151 |
+
await message.reply_text(
|
152 |
+
"GAGAL MENGHAPUS SEMUA PERINGATAN! CEK LAGI USER ID NYA!"
|
153 |
+
)
|
154 |
+
|
155 |
@bot.on_message(filters.command("start") & filters.private)
|
156 |
async def start_command(client, message):
|
157 |
reply_markup = InlineKeyboardMarkup( # type: ignore
|