Пример #1
0
 def leave_bots_from_chat(self, object_id, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.leave_chat(chatId=object_id)
         service_log(email, "Leave")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except amino.exceptions.RemovedFromChat:
         service_log(email, "You are removed from this chatroom")
     except Exception as e:
         service_log(email, str(e))
Пример #2
0
 def start_chat(self, object_id, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.start_chat(userId=object_id, message="")
         service_log(email, "Started chat")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except amino.exceptions.AccessDenied:
         service_log(email, "Access denied")
     except Exception as e:
         service_log(email, str(e))
Пример #3
0
 def unfollow(self, object_id, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.unfollow(userId=object_id)
         service_log(email, "Unfollow")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except amino.exceptions.AccessDenied:
         service_log(email, "Access denied")
     except Exception as e:
         service_log(email, str(e))
Пример #4
0
 def like_blog(self, object_id, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.like_blog(blogId=object_id)
         service_log(email, "Like")
     except amino.exceptions.RequestedNoLongerExists:
         sub_client.like_blog(wikiId=object_id)
         service_log(email, "Like")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #5
0
 def play_lottery(self, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         play = sub_client.lottery()
         award = play.awardValue if play.awardValue else 0
         service_log(email, f"+{award} coins won")
         return int(award)
     except amino.exceptions.AlreadyPlayedLottery:
         service_log(email, "AlreadyPlayedLottery")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #6
0
 def vote_poll(self, blog_id: str, option_id: str, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.vote_poll(blogId=blog_id, optionId=option_id)
         service_log(email, "Voted")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #7
0
 def wall_comment(self, userid: str, text: str, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.comment(message=text, userId=userid)
         service_log(email, "Comment sent")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #8
0
 def set_online_status(self, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.activity_status("on")
         service_log(email, "Online status is set")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #9
0
 def change_nick_random(self, max_length, nick, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         if nick is None:
             nick = UsernameGenerator(2, max_length).generate()
         sub_client.edit_profile(nickname=nick)
         service_log(email, f"Nickname changed to {nick}")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #10
0
 def change_icon_random(self, images: list, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         icon = client.upload_media(
             open(
                 os.path.join(os.getcwd(), "src", "icons",
                              f"{random.choice(images)}"), "rb"), "image")
         sub_client.edit_profile(icon=icon)
         service_log(email, "Icon changed")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #11
0
 def join_bots_to_community(self, inv_link=None, account: dict = None):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     invitation_id = None
     if inv_link:
         invitation_id = client.link_identify(
             code=str(inv_link.split("/")[-1])).get("invitationId")
     if invitation_id:
         try:
             client.join_community(comId=self.com_id,
                                   invitationId=invitation_id)
             service_log(email, "Join")
         except Exception as e:
             service_log(email, str(e))
     if invitation_id is None:
         client.join_community(comId=self.com_id)
         service_log(email, "Join")
Пример #12
0
 def send_coins(self, object_id, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         coins = int(client.get_wallet_info().totalCoins)
         if coins != 0:
             sub_client.send_coins(coins=coins, blogId=object_id)
             service_log(email, f"+{coins} coins")
             return coins
         else:
             service_log(email, "NotEnoughCoins")
     except amino.exceptions.NotEnoughCoins:
         service_log(email, "NotEnoughCoins")
     except amino.exceptions.InvalidRequest:
         service_log(email, "InvalidRequest")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except Exception as e:
         service_log(email, str(e))
Пример #13
0
 def send_message(self, object_id, text, account: dict):
     email = account.get("email")
     client = login_sid(account)
     if not client:
         return
     sub_client = amino.SubClient(comId=self.com_id, client=client)
     try:
         sub_client.send_message(chatId=object_id, message=text)
         service_log(email, "Send")
     except amino.exceptions.YouAreBanned:
         service_log(email, "You are banned")
     except amino.exceptions.RemovedFromChat:
         service_log(email, "You are removed from this chatroom")
     except amino.exceptions.ChatViewOnly:
         service_log(email, "Chat in view only mode")
     except amino.exceptions.AccessDenied:
         service_log(email, "Access denied")
     except Exception as e:
         service_log(email, str(e))
Пример #14
0
def login_sid(account: dict):
    client = amino.Client()
    email = account.get("email")
    sid = account.get("sid")
    is_valid = account.get("isValid")
    if is_valid:
        while True:
            try:
                client.login_sid(sid)
                return client
            except amino.exceptions.ActionNotAllowed:
                client.device_id = client.headers.device_id = random.choice(
                    open(
                        os.path.join(os.getcwd(), "src", "devices",
                                     "devices.txt"),
                        "r").readlines()).replace("\n", "")
            except amino.exceptions.FailedLogin:
                service_log(email, "Failed login")
                return False
            except amino.exceptions.InvalidAccountOrPassword:
                service_log(email, "Invalid account or password")
                return False
            except amino.exceptions.InvalidPassword:
                service_log(email, "Invalid Password")
                return False
            except amino.exceptions.InvalidEmail:
                service_log(email, "Invalid Email")
                return False
            except amino.exceptions.AccountDoesntExist:
                service_log(email, "Account does not exist")
                return False
            except amino.exceptions.VerificationRequired as verify:
                service_log(email, str(verify))
                return False
            except Exception as e:
                service_log(email, str(e))
                logger(traceback.format_exc())
                return False