def getFriends(ids, method): if method == 'list': info = vk.method('friends.get', {"user_id": ids}) for i in range(len(info['items'])): print(Profile.getProfileInfo(info['items'][i])) sleep(1) elif method == 'online': info = vk.method('friends.getOnline', {"user_id": ids}) for i in range(len(info)): print(Profile.getProfileInfo(info[i])) sleep(1)
def execute(command): if command[0].lower() == 'profile': try: print(Profile.getProfileInfo(command[1])) except: print(Profile.getcurrentProfile()) if command[0].lower() == 'friends': Friends.getFriends(command[1], command[2]) if command[0].lower() == 'help': try: Help.help_4_func(command[1]) except: Help.help_4_func(func='help') if command[0].lower() == 'messages': try: print(Messages.Get(command[1].lower())) except: print("Ошибка запроса, попробуйте еще раз") pass if command[0].lower() == 'message': message = input("Write message# ") Messages.Send(command[1], message)