mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 11:04:51 +00:00
Fix bot leave when bot not admin
This commit is contained in:
parent
a4ad5c1730
commit
e59cb75743
1 changed files with 4 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ async def kirimPesan(msg, text, **kwargs):
|
||||||
return await kirimPesan(msg, text, **kwargs)
|
return await kirimPesan(msg, text, **kwargs)
|
||||||
except (ChatWriteForbidden, ChatAdminRequired):
|
except (ChatWriteForbidden, ChatAdminRequired):
|
||||||
LOGGER.info(f"Leaving from {msg.chat.title} [{msg.chat.id}] because doesn't have admin permission.")
|
LOGGER.info(f"Leaving from {msg.chat.title} [{msg.chat.id}] because doesn't have admin permission.")
|
||||||
return await msg.leave()
|
return await msg.chat.leave()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.error(str(e))
|
LOGGER.error(str(e))
|
||||||
return
|
return
|
||||||
|
|
@ -34,6 +34,9 @@ async def editPesan(msg, text, **kwargs):
|
||||||
return await editPesan(msg, text, **kwargs)
|
return await editPesan(msg, text, **kwargs)
|
||||||
except (MessageNotModified, MessageIdInvalid, MessageEmpty):
|
except (MessageNotModified, MessageIdInvalid, MessageEmpty):
|
||||||
return
|
return
|
||||||
|
except (ChatWriteForbidden, ChatAdminRequired):
|
||||||
|
LOGGER.info(f"Leaving from {msg.chat.title} [{msg.chat.id}] because doesn't have admin permission.")
|
||||||
|
return await msg.chat.leave()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.error(str(e))
|
LOGGER.error(str(e))
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue