Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random,os
- from fbchat import log, Client
- import time
- class Thanos(Client):
- def onMessage(self, authorID, messageObject, threadID, threadType, **kwargs):
- self.markAsDelivered(threadID, messageObject.uid)
- self.markAsRead(threadID)
- if authorID == self.uid or messageObject.lower()!="thanos":
- return
- self.send("*snap*", thread_id=threadID, thread_type=threadType)
- threads = self.fetchThreadInfo([threadID])
- allUsersFromThreads = self.fetchAllUsersFromThreads(threads)
- usr2=[]
- for usr in allUsersFromThreads:
- if usr.first_name!="Marek" and usr.uid!=self.uid:
- usr2.append(usr)
- usr2 = random.shuffle(usr2, random.SystemRandom)
- usr2 = usr2[:len(usr2)//2]
- for usr in usr2:
- self.removeUserFromGroup(usr.uid, thred_id=threadID)
- time.sleep(300)
- for usr in usrs:
- s.addUsersToGroup(usr.uid, threadID)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement