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 + ) + ) + )