Skip to content

Commit

Permalink
[Mutes, GMutes] Improvements and fixes
Browse files Browse the repository at this point in the history
Avinash Reddy committed Jan 4, 2020
1 parent 380f302 commit d69d487
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions userbot/modules/admin.py
Original file line number Diff line number Diff line change
@@ -429,12 +429,18 @@ async def muter(moot):
if muted:
for i in muted:
if str(i.sender) == str(moot.sender_id):
await moot.delete()
await moot.client(
EditBannedRequest(moot.chat_id, moot.sender_id, rights))
try:
await moot.delete()
await moot.client(
EditBannedRequest(moot.chat_id, moot.sender_id, rights))
except (BadRequestError, UserAdminInvalidError):
await moot.client.send_read_acknowledge(moot.chat_id, moot.id)
for i in gmuted:
if i.sender == str(moot.sender_id):
await moot.delete()
try:
await moot.delete()
except BadRequestError:
await moot.client.send_read_acknowledge(moot.chat_id, moot.id)


@register(outgoing=True, pattern="^.ungmute(?: |$)(.*)", groups_only=True)

0 comments on commit d69d487

Please sign in to comment.