From f9b3c48a119269a26763df0fa8b39b22fdcc3e8c Mon Sep 17 00:00:00 2001 From: udf Date: Thu, 1 Nov 2018 23:16:48 +0200 Subject: [PATCH] move sp_kick_invite to disabled previously it was unreleased --- disabledplugins/sp_kick_invite.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 disabledplugins/sp_kick_invite.py diff --git a/disabledplugins/sp_kick_invite.py b/disabledplugins/sp_kick_invite.py new file mode 100755 index 0000000..a61e853 --- /dev/null +++ b/disabledplugins/sp_kick_invite.py @@ -0,0 +1,26 @@ +# kicks people who join a group by invite + +import asyncio +from telethon import events + +from telethon.tl.functions.channels import EditBannedRequest +from telethon.tl.types import ChannelBannedRights + +import time + +channel_id = 1252035294 + + +@borg.on(events.ChatAction(chats=channel_id)) +async def on_join(event): + if event.user_joined: + await borg( + EditBannedRequest( + channel=channel_id, + user_id=await event.get_user(), + banned_rights=ChannelBannedRights( + time.time() + 60, + True, True, True, True, True, True, True, True + ) + ) + )