How to use the vkbottle.types.responses.friends function in vkbottle

To help you get started, we’ve selected a few vkbottle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
async def __call__(
        self, phones: typing.List = None, fields: typing.List = None
    ) -> responses.friends.GetByPhones:
        """ friends.getByPhones
        From Vk Docs: Returns a list of the current user's friends whose phone numbers, validated or specified in a profile, are in a given list.
        Access from user token(s)
        :param phones: List of phone numbers in MSISDN format (maximum 1000). Example: "+79219876543,+79111234567"
        :param fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online, counters'.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.getByPhones",
            params,
            response_model=responses.friends.GetByPhonesModel,
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
Access from user token(s)
        :param source_uid: ID of the user whose friends will be checked against the friends of the user specified in 'target_uid'.
        :param target_uid: ID of the user whose friends will be checked against the friends of the user specified in 'source_uid'.
        :param target_uids: IDs of the users whose friends will be checked against the friends of the user specified in 'source_uid'.
        :param order: Sort order: 'random' — random order
        :param count: Number of mutual friends to return.
        :param offset: Offset needed to return a specific subset of mutual friends.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.getMutual", params, response_model=responses.friends.GetMutualModel
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
Access from user token(s)
        :param user_id: User ID.
        :param list_id: Friend list ID. If this parameter is not set, information about all online friends is returned.
        :param online_mobile: '1' — to return an additional 'online_mobile' field, '0' — (default),
        :param order: Sort order: 'random' — random order
        :param count: Number of friends to return.
        :param offset: Offset needed to return a specific subset of friends.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.getOnline", params, response_model=responses.friends.GetOnlineModel
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
:param filter: Types of potential friends to return: 'mutual' — users with many mutual friends , 'contacts' — users found with the [vk.com/dev/account.importContacts|account.importContacts] method , 'mutual_contacts' — users who imported the same contacts as the current user with the [vk.com/dev/account.importContacts|account.importContacts] method
        :param count: Number of suggestions to return.
        :param offset: Offset needed to return a specific subset of suggestions.
        :param fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'.
        :param name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.getSuggestions",
            params,
            response_model=responses.friends.GetSuggestionsModel,
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
    async def __call__(self, count: int = None) -> responses.friends.GetRecent:
        """ friends.getRecent
        From Vk Docs: Returns a list of user IDs of the current user's recently added friends.
        Access from user token(s)
        :param count: Number of recently added friends to return.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.getRecent", params, response_model=responses.friends.GetRecentModel
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
async def __call__(
        self, user_id: int = None, text: str = None, follow: bool = None
    ) -> responses.friends.Add:
        """ friends.add
        From Vk Docs: Approves or creates a friend request.
        Access from user token(s)
        :param user_id: ID of the user whose friend request will be approved or to whom a friend request will be sent.
        :param text: Text of the message (up to 500 characters) for the friend request, if any.
        :param follow: '1' to pass an incoming request to followers list.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.add", params, response_model=responses.friends.AddModel
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
    async def __call__(self, user_id: int = None) -> responses.friends.Delete:
        """ friends.delete
        From Vk Docs: Declines a friend request or deletes a user from the current user's friend list.
        Access from user token(s)
        :param user_id: ID of the user whose friend request is to be declined or who is to be deleted from the current user's friend list.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.delete", params, response_model=responses.friends.DeleteModel
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
async def __call__(self, user_id: int = None) -> responses.friends.Delete:
        """ friends.delete
        From Vk Docs: Declines a friend request or deletes a user from the current user's friend list.
        Access from user token(s)
        :param user_id: ID of the user whose friend request is to be declined or who is to be deleted from the current user's friend list.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
        return await self.request(
            "friends.delete", params, response_model=responses.friends.DeleteModel
        )
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
async def __call__(
        self,
        user_id: int = None,
        list_id: int = None,
        online_mobile: bool = None,
        order: str = None,
        count: int = None,
        offset: int = None,
    ) -> responses.friends.GetOnline:
        """ friends.getOnline
        From Vk Docs: Returns a list of user IDs of a user's friends who are online.
        Access from user token(s)
        :param user_id: User ID.
        :param list_id: Friend list ID. If this parameter is not set, information about all online friends is returned.
        :param online_mobile: '1' — to return an additional 'online_mobile' field, '0' — (default),
        :param order: Sort order: 'random' — random order
        :param count: Number of friends to return.
        :param offset: Offset needed to return a specific subset of friends.
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
            if k not in ["self"] and v is not None
        }
github timoniq / vkbottle / vkbottle / types / methods / friends.py View on Github external
async def __call__(
        self,
        user_id: int = None,
        order: str = None,
        list_id: int = None,
        count: int = None,
        offset: int = None,
        fields: typing.List = None,
        name_case: str = None,
        ref: str = None,
    ) -> responses.friends.Get:
        """ friends.get
        From Vk Docs: Returns a list of user IDs or detailed information about a user's friends.
        Access from user, service token(s)
        :param user_id: User ID. By default, the current user ID.
        :param order: Sort order: , 'name' — by name (enabled only if the 'fields' parameter is used), 'hints' — by rating, similar to how friends are sorted in My friends section, , This parameter is available only for [vk.com/dev/standalone|desktop applications].
        :param list_id: ID of the friend list returned by the [vk.com/dev/friends.getLists|friends.getLists] method to be used as the source. This parameter is taken into account only when the uid parameter is set to the current user ID. This parameter is available only for [vk.com/dev/standalone|desktop applications].
        :param count: Number of friends to return.
        :param offset: Offset needed to return a specific subset of friends.
        :param fields: Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', 'nickname', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'domain', 'has_mobile', 'rate', 'contacts', 'education'.
        :param name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional
        :param ref: 
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()