Skip to content

Commit

Permalink
don't send broadcast to admins
Browse files Browse the repository at this point in the history
  • Loading branch information
mrismanaziz authored Apr 10, 2022
1 parent 38c3cd8 commit 0fc46d2
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions plugins/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,30 +176,28 @@ async def send_text(client: Bot, message: Message):
)
for row in query:
chat_id = int(row[0])
try:
await broadcast_msg.copy(chat_id)
successful += 1
except FloodWait as e:
await asyncio.sleep(e.x)
await broadcast_msg.copy(chat_id)
successful += 1
except UserIsBlocked:
blocked += 1
except InputUserDeactivated:
deleted += 1
except BaseException:
unsuccessful += 1
total += 1

if chat_id not in ADMINS:
try:
await broadcast_msg.copy(chat_id)
successful += 1
except FloodWait as e:
await asyncio.sleep(e.x)
await broadcast_msg.copy(chat_id)
successful += 1
except UserIsBlocked:
blocked += 1
except InputUserDeactivated:
deleted += 1
except BaseException:
unsuccessful += 1
total += 1
status = f"""<b><u>Berhasil Broadcast</u>
Jumlah Pengguna: <code>{total}</code>
Berhasil: <code>{successful}</code>
Gagal: <code>{unsuccessful}</code>
Pengguna diblokir: <code>{blocked}</code>
Akun Terhapus: <code>{deleted}</code></b>"""

return await pls_wait.edit(status)

else:
msg = await message.reply(
"<code>Gunakan Perintah ini Harus Sambil Reply ke pesan telegram yang ingin di Broadcast.</code>"
Expand Down

0 comments on commit 0fc46d2

Please sign in to comment.