import VK from '..' import makeVkRequest from '../utils/makeVkRequest' import { ArrayResponse, arrayResponseDecoder } from '../utils/typesAndDecoders/arrayResponse' import { Message, messageDecoder } from '../utils/typesAndDecoders/message' export type MessagesSearchResponse = ArrayResponse const messagesSearchDecoder = arrayResponseDecoder(messageDecoder, 'messages.search Decoder') const messagesSearch = async (vk: VK, query: string): Promise => await makeVkRequest('messages.search', vk.accessToken, vk.settings.lang, messagesSearchDecoder, { q: query, }) export default messagesSearch