How to use the airgram.isError function in airgram

To help you get started, we’ve selected a few airgram 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 airgram / airgram / examples / custom-context / src / index.ts View on Github external
}).then(({ response, $store }) => {
  if (isError(response)) {
    throw new Error(`[TDLib][${response.code}] ${response.message}`)
  }
  const chats = response.chatIds.map((chatId) => {
    const chat = $store.chats.get(chatId)
    const message = $store.chatLastMessage.get(chatId)

    if (!chat || !message || !message.lastMessage) {
      throw new Error('Invalidate store')
    }

    const { lastMessage } = message
    const { title } = chat
    const sentBy = $store.users.get(lastMessage.senderUserId)

    return {
      title,
github airgram / airgram / examples / getting-started / src / index.ts View on Github external
}).then(({ request, response }) => {
  if (isError(response)) {
    writeError(`[${request.method}][${response.code}] ${response.message}`)
  } else {
    writeInfo('Profile photo has been loaded.')
  }
})

airgram

Documentation is available [here](https://airgram.io).

GPL-3.0
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis