Hierarchy

  • RawClient

Constructors

Properties

Methods

acceptChat accountsBackgroundFetch addAccount addContactToChat addDeviceMessage batchGetConfig batchSetConfig blockChat blockContact canSend changeContactName checkEmailValidity checkQr configure continueAutocryptKeyTransfer createBroadcastList createChatByContactId createContact createGroupChat deleteChat deleteContact deleteMessages downloadFullMessage draftSelfReport estimateAutoDeletionCount exportBackup exportSelfKeys forwardMessages getAccountFileSize getAccountInfo getAllAccountIds getAllAccounts getBackup getBackupQr getBackupQrSvg getBasicChatInfo getBlobDir getBlockedContacts getChatContacts getChatEncryptionInfo getChatEphemeralTimer getChatIdByContactId getChatMedia getChatSecurejoinQrCode getChatSecurejoinQrCodeSvg getChatlistEntries getChatlistItemsByEntries getConfig getConnectivity getConnectivityHtml getContact getContactEncryptionInfo getContactIds getContacts getContactsByIds getDraft getFirstUnreadMessageOfChat getFreshMsgCnt getFreshMsgs getFullChatById getHttpResponse getInfo getLocations getMessage getMessageHtml getMessageIds getMessageInfo getMessageInfoObject getMessageListItems getMessageNotificationInfo getMessageReactions getMessageReadReceipts getMessages getNextEvent getNextMsgs getProviderInfo getSelectedAccountId getSimilarChatIds getSystemInfo getWebxdcBlob getWebxdcInfo getWebxdcStatusUpdates importBackup importSelfKeys importVcard initWebxdcIntegration initiateAutocryptKeyTransfer isChatMuted isConfigured leaveGroup leaveWebxdcRealtime lookupContactIdByAddr makeVcard marknoticedChat markseenMsgs maybeNetwork messageIdsToSearchResults migrateAccount miscGetStickerFolder miscGetStickers miscSaveSticker miscSendDraft miscSendMsg miscSendTextMessage miscSetDraft parseVcard provideBackup removeAccount removeContactFromChat removeDraft resendMessages resetContactEncryption saveMsgFile searchMessages secureJoin selectAccount sendMsg sendReaction sendSticker sendVideochatInvitation sendWebxdcRealtimeAdvertisement sendWebxdcRealtimeData sendWebxdcStatusUpdate setChatEphemeralTimer setChatMuteDuration setChatName setChatProfileImage setChatVisibility setConfig setConfigFromQr setDraftVcard setStockStrings setWebxdcIntegration sleep startIo startIoForAllAccounts stopIo stopIoForAllAccounts stopOngoingProcess unblockContact waitNextMsgs

Constructors

  • Parameters

    • _transport: Transport

    Returns RawClient

Properties

_transport: Transport

Methods

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null>

  • Performs a background fetch for all accounts in parallel with a timeout.

    The AccountsBackgroundFetchDone event is emitted at the end even in case of timeout. Process all events until you get this one and you can safely return to the background without forgetting to create notifications caused by timing race conditions.

    Parameters

    • timeoutInSeconds: number

    Returns Promise<null>

  • Returns Promise<number>

  • Add a member to a group.

    If the group is already promoted (any message was sent to the group), all group members are informed by a special status message that is sent automatically by this function.

    If the group has group protection enabled, only verified contacts can be added to the group.

    Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent.

    Parameters

    • accountId: number
    • chatId: number
    • contactId: number

    Returns Promise<null>

  • Add a message to the device-chat. Device-messages usually contain update information and some hints that are added during the program runs, multi-device etc. The device-message may be defined by a label; if a message with the same label was added or skipped before, the message is not added again, even if the message was deleted in between. If needed, the device-chat is created before.

    Sends the MsgsChanged event on success.

    Setting msg to None will prevent the device message with this label from being added in the future.

    Parameters

    • accountId: number
    • label: string
    • msg: null | MessageData

    Returns Promise<null | number>

  • Parameters

    • accountId: number
    • keys: string[]

    Returns Promise<Record<string, null | string>>

  • Updates a batch of configuration values.

    Parameters

    • accountId: number
    • config: Record<string, null | string>

    Returns Promise<null>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • contactId: number

    Returns Promise<null>

  • Checks if messages can be sent to a given chat.

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<boolean>

  • Parameters

    • accountId: number
    • contactId: number
    • name: string

    Returns Promise<null>

  • Checks if an email address is valid.

    Parameters

    • email: string

    Returns Promise<boolean>

  • Parameters

    • accountId: number
    • qrContent: string

    Returns Promise<Qr>

  • Configures this account with the currently set parameters. Setup the credential config before calling this.

    Parameters

    • accountId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • messageId: number
    • setupCode: string

    Returns Promise<null>

  • Create a new broadcast list.

    Broadcast lists are similar to groups on the sending device, however, recipients get the messages in a read-only chat and will see who the other members are.

    For historical reasons, this function does not take a name directly, instead you have to set the name using dc_set_chat_name() after creating the broadcast list.

    Parameters

    • accountId: number

    Returns Promise<number>

  • Returns contact id of the created or existing DM chat with that contact

    Parameters

    • accountId: number
    • contactId: number

    Returns Promise<number>

  • Add a single contact as a result of an explicit user action.

    Returns contact id of the created or existing contact

    Parameters

    • accountId: number
    • email: string
    • name: null | string

    Returns Promise<number>

  • Create a new group chat.

    After creation, the group has one member with the ID DC_CONTACT_ID_SELF and is in unpromoted state. This means, you can add or remove members, change the name, the group image and so on without messages being sent to all group members.

    This changes as soon as the first message is sent to the group members and the group becomes promoted. After that, all changes are synced with all group members by sending status message.

    To check, if a chat is still unpromoted, you can look at the is_unpromoted property of BasicChat or FullChat. This may be useful if you want to show some help for just created groups.

    Parameters

    • accountId: number
    • name: string
    • protect: boolean

      If set to 1 the function creates group with protection initially enabled. Only verified members are allowed in these groups and end-to-end-encryption is always enabled.

    Returns Promise<number>

  • Delete a chat.

    Messages are deleted from the device and the chat database entry is deleted. After that, the event #DC_EVENT_MSGS_CHANGED is posted.

    Things that are not done implicitly:

    • Messages are not deleted from the server.
    • The chat or the contact is not blocked, so new messages from the user/the group may appear as a contact request and the user may create the chat again.
    • Groups are not left - this would be unexpected as (1) deleting a normal chat also does not prevent new mails from arriving, (2) leaving a group requires sending a message to all group members - especially for groups not used for a longer time, this is really unexpected when deletion results in contacting all members again, (3) only leaving groups is also a valid usecase.

    To leave a chat explicitly, use leave_group()

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • contactId: number

    Returns Promise<null>

  • Delete messages. The messages are deleted on the current device and on the IMAP server.

    Parameters

    • accountId: number
    • messageIds: number[]

    Returns Promise<null>

  • Asks the core to start downloading a message fully. This function is typically called when the user hits the "Download" button that is shown by the UI in case download_state is 'Available' or 'Failure'

    On success, the

    Ref

    DC_MSG "view type of the message" may change or the message may be replaced completely by one or more messages with other message IDs. That may happen e.g. in cases where the message was encrypted and the type could not be determined without fully downloading. Downloaded content can be accessed as usual after download.

    To reflect these changes a

    Ref

    DC_EVENT_MSGS_CHANGED event will be emitted.

    Parameters

    • accountId: number
    • messageId: number

    Returns Promise<null>

  • Parameters

    • accountId: number

    Returns Promise<number>

  • Estimate the number of messages that will be deleted by the set_config()-options delete_device_after or delete_server_after. This is typically used to show the estimated impact to the user before actually enabling deletion of old messages.

    Parameters

    • accountId: number
    • fromServer: boolean
    • seconds: number

    Returns Promise<number>

  • Parameters

    • accountId: number
    • destination: string
    • passphrase: null | string

    Returns Promise<null>

  • Parameters

    • accountId: number
    • path: string
    • passphrase: null | string

    Returns Promise<null>

  • Forward messages to another chat.

    All types of messages can be forwarded, however, they will be flagged as such (dc_msg_is_forwarded() is set).

    Original sender, info-state and webxdc updates are not forwarded on purpose.

    Parameters

    • accountId: number
    • messageIds: number[]
    • chatId: number

    Returns Promise<null>

  • Get the combined filesize of an account in bytes

    Parameters

    • accountId: number

    Returns Promise<number>

  • Get top-level info for an account.

    Parameters

    • accountId: number

    Returns Promise<Account>

  • Returns Promise<number[]>

  • Get a list of all configured accounts.

    Returns Promise<Account[]>

  • Gets a backup from a remote provider.

    This retrieves the backup from a remote device over the network and imports it into the current device.

    Can be cancelled by stopping the ongoing process.

    Do not forget to call start_io on the account after a successful import, otherwise it will not connect to the email server.

    Parameters

    • accountId: number
    • qrText: string

    Returns Promise<null>

  • Returns the text of the QR code for the running [CommandApi::provide_backup].

    This QR code text can be used in [CommandApi::get_backup] on a second device to retrieve the backup and setup this second device.

    This call will block until the QR code is ready, even if there is no concurrent call to [CommandApi::provide_backup], but will fail after 60 seconds to avoid deadlocks.

    Parameters

    • accountId: number

    Returns Promise<string>

  • Returns the rendered QR code for the running [CommandApi::provide_backup].

    This QR code can be used in [CommandApi::get_backup] on a second device to retrieve the backup and setup this second device.

    This call will block until the QR code is ready, even if there is no concurrent call to [CommandApi::provide_backup], but will fail after 60 seconds to avoid deadlocks.

    Returns the QR code rendered as an SVG image.

    Parameters

    • accountId: number

    Returns Promise<string>

  • get basic info about a chat, use chatlist_get_full_chat_by_id() instead if you need more information

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<BasicChat>

  • Parameters

    • accountId: number

    Returns Promise<null | string>

  • Parameters

    • accountId: number

    Returns Promise<Contact[]>

  • Get the contact IDs belonging to a chat.

    • for normal chats, the function always returns exactly one contact, DC_CONTACT_ID_SELF is returned only for SELF-chats.

    • for group chats all members are returned, DC_CONTACT_ID_SELF is returned explicitly as it may happen that oneself gets removed from a still existing group

    • for broadcasts, all recipients are returned, DC_CONTACT_ID_SELF is not included

    • for mailing lists, the behavior is not documented currently, we will decide on that later. for now, the UI should not show the list for mailing lists. (we do not know all members and there is not always a global mailing list address, so we could return only SELF or the known members; this is not decided yet)

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<number[]>

  • Get encryption info for a chat. Get a multi-line encryption info, containing encryption preferences of all members. Can be used to find out why messages sent to group are not encrypted.

    returns Multi-line text

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<string>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<number>

  • Returns the [ChatId] for the 1:1 chat with contact_id if it exists.

    If it does not exist, None is returned.

    Parameters

    • accountId: number
    • contactId: number

    Returns Promise<null | number>

  • Returns all message IDs of the given types in a chat. Typically used to show a gallery.

    The list is already sorted and starts with the oldest message. Clients should not try to re-sort the list as this would be an expensive action and would result in inconsistencies between clients.

    Setting chat_id to None (null in typescript) means get messages with media from any chat of the currently used account.

    Parameters

    • accountId: number
    • chatId: null | number
    • messageType: Viewtype
    • orMessageType2: null | Viewtype
    • orMessageType3: null | Viewtype

    Returns Promise<number[]>

  • Get QR code text that will offer a SecureJoin invitation.

    If chat_id is a group chat ID, SecureJoin QR code for the group is returned. If chat_id is unset, setup contact QR code is returned.

    Parameters

    • accountId: number
    • chatId: null | number

    Returns Promise<string>

  • Get QR code (text and SVG) that will offer a Setup-Contact or Verified-Group invitation. The QR code is compatible to the OPENPGP4FPR format so that a basic fingerprint comparison also works e.g. with OpenKeychain.

    The scanning device will pass the scanned content to checkQr() then; if checkQr() returns askVerifyContact or askVerifyGroup an out-of-band-verification can be joined using secure_join()

    chat_id: If set to a group-chat-id, the Verified-Group-Invite protocol is offered in the QR code; works for protected groups as well as for normal groups. If not set, the Setup-Contact protocol is offered in the QR code. See https://securejoin.delta.chat/ for details about both protocols.

    return format: [code, svg]

    Parameters

    • accountId: number
    • chatId: null | number

    Returns Promise<[string, string]>

  • Parameters

    • accountId: number
    • listFlags: null | number
    • queryString: null | string
    • queryContactId: null | number

    Returns Promise<number[]>

  • Parameters

    • accountId: number
    • entries: number[]

    Returns Promise<Record<number, ChatListItemFetchResult>>

  • Returns configuration value for the given key.

    Parameters

    • accountId: number
    • key: string

    Returns Promise<null | string>

  • Get the current connectivity, i.e. whether the device is connected to the IMAP server. One of:

    • DC_CONNECTIVITY_NOT_CONNECTED (1000-1999): Show e.g. the string "Not connected" or a red dot
    • DC_CONNECTIVITY_CONNECTING (2000-2999): Show e.g. the string "Connecting…" or a yellow dot
    • DC_CONNECTIVITY_WORKING (3000-3999): Show e.g. the string "Getting new messages" or a spinning wheel
    • DC_CONNECTIVITY_CONNECTED (>=4000): Show e.g. the string "Connected" or a green dot

    We don't use exact values but ranges here so that we can split up states into multiple states in the future.

    Meant as a rough overview that can be shown e.g. in the title of the main screen.

    If the connectivity changes, a #DC_EVENT_CONNECTIVITY_CHANGED will be emitted.

    Parameters

    • accountId: number

    Returns Promise<number>

  • Get an overview of the current connectivity, and possibly more statistics. Meant to give the user more insight about the current status than the basic connectivity info returned by get_connectivity(); show this e.g., if the user taps on said basic connectivity info.

    If this page changes, a #DC_EVENT_CONNECTIVITY_CHANGED will be emitted.

    This comes as an HTML from the core so that we can easily improve it and the improvement instantly reaches all UIs.

    Parameters

    • accountId: number

    Returns Promise<string>

  • Get a single contact options by ID.

    Parameters

    • accountId: number
    • contactId: number

    Returns Promise<Contact>

  • Get encryption info for a contact. Get a multi-line encryption info, containing your fingerprint and the fingerprint of the contact, used e.g. to compare the fingerprints for a simple out-of-band verification.

    Parameters

    • accountId: number
    • contactId: number

    Returns Promise<string>

  • Parameters

    • accountId: number
    • listFlags: number
    • query: null | string

    Returns Promise<number[]>

  • Get a list of contacts. (formerly called getContacts2 in desktop)

    Parameters

    • accountId: number
    • listFlags: number
    • query: null | string

    Returns Promise<Contact[]>

  • Parameters

    • accountId: number
    • ids: number[]

    Returns Promise<Record<number, Contact>>

  • Get draft for a chat, if any.

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null | T.Message>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null | number>

  • Get the number of fresh messages in a chat. Typically used to implement a badge with a number in the chatlist.

    If the specified chat is muted, the UI should show the badge counter "less obtrusive", e.g. using "gray" instead of "red" color.

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<number>

  • Returns the message IDs of all fresh messages of any chat. Typically used for implementing notification summaries or badge counters e.g. on the app icon. The list is already sorted and starts with the most recent fresh message.

    Messages belonging to muted chats or to the contact requests are not returned; these messages should not be notified and also badge counters should not include these messages.

    To get the number of fresh messages for a single chat, muted or not, use get_fresh_msg_cnt().

    Parameters

    • accountId: number

    Returns Promise<number[]>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<FullChat>

  • Makes an HTTP GET request and returns a response.

    url is the HTTP or HTTPS URL.

    Parameters

    • accountId: number
    • url: string

    Returns Promise<HttpResponse>

  • Get system info for an account.

    Parameters

    • accountId: number

    Returns Promise<Record<string, string>>

  • Parameters

    • accountId: number
    • chatId: null | number
    • contactId: null | number
    • timestampBegin: number
    • timestampEnd: number

    Returns Promise<Location[]>

  • Parameters

    • accountId: number
    • msgId: number

    Returns Promise<T.Message>

  • Parameters

    • accountId: number
    • messageId: number

    Returns Promise<null | string>

  • Parameters

    • accountId: number
    • chatId: number
    • infoOnly: boolean
    • addDaymarker: boolean

    Returns Promise<number[]>

  • Get an informational text for a single message. The text is multiline and may contain e.g. the raw text of the message.

    The max. text returned is typically longer (about 100000 characters) than the max. text returned by dc_msg_get_text() (about 30000 characters).

    Parameters

    • accountId: number
    • messageId: number

    Returns Promise<string>

  • Returns additional information for single message.

    Parameters

    • accountId: number
    • messageId: number

    Returns Promise<MessageInfo>

  • Parameters

    • accountId: number
    • chatId: number
    • infoOnly: boolean
    • addDaymarker: boolean

    Returns Promise<MessageListItem[]>

  • Fetch info desktop needs for creating a notification for a message

    Parameters

    • accountId: number
    • messageId: number

    Returns Promise<MessageNotificationInfo>

  • Returns reactions to the message.

    Parameters

    • accountId: number
    • messageId: number

    Returns Promise<null | Reactions>

  • Returns contacts that sent read receipts and the time of reading.

    Parameters

    • accountId: number
    • messageId: number

    Returns Promise<MessageReadReceipt[]>

  • get multiple messages in one call, if loading one message fails the error is stored in the result object in it's place.

    this is the batch variant of [get_message]

    Parameters

    • accountId: number
    • messageIds: number[]

    Returns Promise<Record<number, MessageLoadResult>>

  • Get the next event.

    Returns Promise<Event>

  • Gets messages to be processed by the bot and returns their IDs.

    Only messages with database ID higher than last_msg_id config value are returned. After processing the messages, the bot should update last_msg_id by calling markseen_msgs or manually updating the value to avoid getting already processed messages.

    Parameters

    • accountId: number

    Returns Promise<number[]>

  • Returns provider for the given domain.

    This function looks up domain in offline database.

    For compatibility, email address can be passed to this function instead of the domain.

    Parameters

    • accountId: number
    • email: string

    Returns Promise<null | ProviderInfo>

  • Get the selected account id of the internal state.. TODO: Likely this is deprecated as all methods take an account id now.

    Returns Promise<null | number>

  • Returns chats similar to the given one.

    Experimental API, subject to change without notice.

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<number[]>

  • Returns general system info.

    Returns Promise<Record<string, string>>

  • Get blob encoded as base64 from a webxdc message

    path is the path of the file within webxdc archive

    Parameters

    • accountId: number
    • instanceMsgId: number
    • path: string

    Returns Promise<string>

  • Get info from a webxdc message

    Parameters

    • accountId: number
    • instanceMsgId: number

    Returns Promise<WebxdcMessageInfo>

  • Parameters

    • accountId: number
    • instanceMsgId: number
    • lastKnownSerial: number

    Returns Promise<string>

  • Parameters

    • accountId: number
    • path: string
    • passphrase: null | string

    Returns Promise<null>

  • Parameters

    • accountId: number
    • path: string
    • passphrase: null | string

    Returns Promise<null>

  • Imports contacts from a vCard file located at the given path.

    Returns the ids of created/modified contacts in the order they appear in the vCard.

    Parameters

    • accountId: number
    • path: string

    Returns Promise<number[]>

  • Returns Webxdc instance used for optional integrations. UI can open the Webxdc as usual. Returns None if there is no integration; the caller can add one using set_webxdc_integration then. integrate_for is the chat to get the integration for.

    Parameters

    • accountId: number
    • chatId: null | number

    Returns Promise<null | number>

  • Parameters

    • accountId: number

    Returns Promise<string>

  • Check whether the chat is currently muted (can be changed by set_chat_mute_duration()).

    This is available as a standalone function outside of fullchat, because it might be only needed for notification

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<boolean>

  • Checks if the context is already configured.

    Parameters

    • accountId: number

    Returns Promise<boolean>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • instanceMessageId: number

    Returns Promise<null>

  • Check if an e-mail address belongs to a known and unblocked contact. To get a list of all known and unblocked contacts, use contacts_get_contacts().

    To validate an e-mail address independently of the contact database use check_email_validity().

    Parameters

    • accountId: number
    • addr: string

    Returns Promise<null | number>

  • Returns a vCard containing contacts with the given ids.

    Parameters

    • accountId: number
    • contacts: number[]

    Returns Promise<string>

  • Mark all messages in a chat as noticed. Noticed messages are no longer fresh and do not count as being unseen but are still waiting for being marked as "seen" using markseen_msgs() (IMAP/MDNs is not done for noticed messages).

    Calling this function usually results in the event #DC_EVENT_MSGS_NOTICED. See also markseen_msgs().

    Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null>

  • Mark messages as presented to the user. Typically, UIs call this function on scrolling through the message list, when the messages are presented at least for a little moment. The concrete action depends on the type of the chat and on the users settings (dc_msgs_presented() may be a better name therefore, but well. :)

    • For normal chats, the IMAP state is updated, MDN is sent (if set_config()-options mdns_enabled is set) and the internal state is changed to

    Ref

    DC_STATE_IN_SEEN to reflect these actions.

    • For contact requests, no IMAP or MDNs is done and the internal state is not changed therefore. See also marknoticed_chat().

    Moreover, timer is started for incoming ephemeral messages. This also happens for contact requests chats.

    This function updates last_msg_id configuration value to the maximum of the current value and IDs passed to this function. Bots which mark messages as seen can rely on this side effect to avoid updating last_msg_id value manually.

    One #DC_EVENT_MSGS_NOTICED event is emitted per modified chat.

    Parameters

    • accountId: number
    • msgIds: number[]

    Returns Promise<null>

  • Indicate that the network likely has come back. or just that the network conditions might have changed

    Returns Promise<null>

  • Parameters

    • accountId: number
    • messageIds: number[]

    Returns Promise<Record<number, MessageSearchResult>>

  • Imports/migrated an existing account from a database path into this account manager. Returns the ID of new account.

    Parameters

    • pathToDb: string

    Returns Promise<number>

  • Parameters

    • accountId: number

    Returns Promise<string>

  • for desktop, get stickers from stickers folder, grouped by the collection/folder they are in.

    Parameters

    • accountId: number

    Returns Promise<Record<string, string[]>>

  • Saves a sticker to a collection/folder in the account's sticker folder.

    Parameters

    • accountId: number
    • msgId: number
    • collection: string

    Returns Promise<null>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<number>

  • Parameters

    • accountId: number
    • chatId: number
    • text: null | string
    • file: null | string
    • location: null | [number, number]
    • quotedMessageId: null | number

    Returns Promise<[number, T.Message]>

  • Returns the messageid of the sent message

    Parameters

    • accountId: number
    • chatId: number
    • text: string

    Returns Promise<number>

  • Parameters

    • accountId: number
    • chatId: number
    • text: null | string
    • file: null | string
    • quotedMessageId: null | number
    • viewType: null | Viewtype

    Returns Promise<null>

  • Parses a vCard file located at the given path. Returns contacts in their original order.

    Parameters

    • path: string

    Returns Promise<VcardContact[]>

  • Offers a backup for remote devices to retrieve.

    Can be cancelled by stopping the ongoing process. Success or failure can be tracked via the ImexProgress event which should either reach 1000 for success or 0 for failure.

    This stops IO while it is running.

    Returns once a remote device has retrieved the backup, or is cancelled.

    Parameters

    • accountId: number

    Returns Promise<null>

  • Parameters

    • accountId: number

    Returns Promise<null>

  • Remove a member from a group.

    If the group is already promoted (any message was sent to the group), all group members are informed by a special status message that is sent automatically by this function.

    Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent.

    Parameters

    • accountId: number
    • chatId: number
    • contactId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<null>

  • Resend messages and make information available for newly added chat members. Resending sends out the original message, however, recipients and webxdc-status may differ. Clients that already have the original message can still ignore the resent message as they have tracked the state by dedicated updates.

    Some messages cannot be resent, eg. info-messages, drafts, already pending messages or messages that are not sent by SELF.

    message_ids all message IDs that should be resend. All messages must belong to the same chat.

    Parameters

    • accountId: number
    • messageIds: number[]

    Returns Promise<null>

  • Resets contact encryption.

    Parameters

    • accountId: number
    • contactId: number

    Returns Promise<null>

  • Saves a file copy at the user-provided path.

    Fails if file already exists at the provided path.

    Parameters

    • accountId: number
    • msgId: number
    • path: string

    Returns Promise<null>

  • Search messages containing the given query string. Searching can be done globally (chat_id=None) or in a specified chat only (chat_id set).

    Global search results are typically displayed using dc_msg_get_summary(), chat search results may just highlight the corresponding messages and present a prev/next button.

    For the global search, the result is limited to 1000 messages, this allows an incremental search done fast. So, when getting exactly 1000 messages, the result actually may be truncated; the UIs may display sth. like "1000+ messages found" in this case. The chat search (if chat_id is set) is not limited.

    Parameters

    • accountId: number
    • query: string
    • chatId: null | number

    Returns Promise<number[]>

  • Continue a Setup-Contact or Verified-Group-Invite protocol started on another device with get_chat_securejoin_qr_code_svg(). This function is typically called when check_qr() returns type=AskVerifyContact or type=AskVerifyGroup.

    The function returns immediately and the handshake runs in background, sending and receiving several messages. During the handshake, info messages are added to the chat, showing progress, success or errors.

    Subsequent calls of secure_join() will abort previous, unfinished handshakes.

    See https://securejoin.delta.chat/ for details about both protocols.

    qr: The text of the scanned QR code. Typically, the same string as given to check_qr().

    returns: The chat ID of the joined chat, the UI may redirect to the this chat. A returned chat ID does not guarantee that the chat is protected or the belonging contact is verified.

    Parameters

    • accountId: number
    • qr: string

    Returns Promise<number>

  • Select account id for internally selected state. TODO: Likely this is deprecated as all methods take an account id now.

    Parameters

    • id: number

    Returns Promise<null>

  • Parameters

    Returns Promise<number>

  • Send a reaction to message.

    Reaction is a string of emojis separated by spaces. Reaction to a single message can be sent multiple times. The last reaction received overrides all previously received reactions. It is possible to remove all reactions by sending an empty string.

    Parameters

    • accountId: number
    • messageId: number
    • reaction: string[]

    Returns Promise<number>

  • Parameters

    • accountId: number
    • chatId: number
    • stickerPath: string

    Returns Promise<number>

  • Parameters

    • accountId: number
    • chatId: number

    Returns Promise<number>

  • Parameters

    • accountId: number
    • instanceMsgId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • instanceMsgId: number
    • data: number[]

    Returns Promise<null>

  • Parameters

    • accountId: number
    • instanceMsgId: number
    • updateStr: string
    • description: string

    Returns Promise<null>

  • Parameters

    • accountId: number
    • chatId: number
    • timer: number

    Returns Promise<null>

  • Set mute duration of a chat.

    The UI can then call is_chat_muted() when receiving a new message to decide whether it should trigger an notification.

    Muted chats should not sound or vibrate and should not show a visual notification in the system area. Moreover, muted chats should be excluded from global badge counter (get_fresh_msgs() skips muted chats therefore) and the in-app, per-chat badge counter should use a less obtrusive color.

    Sends out #DC_EVENT_CHAT_MODIFIED.

    Parameters

    Returns Promise<null>

  • Set group name.

    If the group is already promoted (any message was sent to the group), all group members are informed by a special status message that is sent automatically by this function.

    Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent.

    Parameters

    • accountId: number
    • chatId: number
    • newName: string

    Returns Promise<null>

  • Set group profile image.

    If the group is already promoted (any message was sent to the group), all group members are informed by a special status message that is sent automatically by this function.

    Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent.

    To find out the profile image of a chat, use dc_chat_get_profile_image()

    Parameters

    • accountId: number
    • chatId: number
    • imagePath: null | string

    Returns Promise<null>

  • Parameters

    Returns Promise<null>

  • Sets the given configuration key.

    Parameters

    • accountId: number
    • key: string
    • value: null | string

    Returns Promise<null>

  • Set configuration values from a QR code. (technically from the URI that is stored in the qrcode) Before this function is called, checkQr() should confirm the type of the QR code is account or webrtcInstance.

    Internally, the function will call dc_set_config() with the appropriate keys,

    Parameters

    • accountId: number
    • qrContent: string

    Returns Promise<null>

  • Sets vCard containing the given contacts to the message draft.

    Parameters

    • accountId: number
    • msgId: number
    • contacts: number[]

    Returns Promise<null>

  • Parameters

    • strings: Record<number, string>

    Returns Promise<null>

  • Sets Webxdc file as integration. file is the .xdc to use as Webxdc integration.

    Parameters

    • accountId: number
    • filePath: string

    Returns Promise<null>

  • Test function.

    Parameters

    • delay: number

    Returns Promise<void>

  • Starts background tasks for a single account.

    Parameters

    • accountId: number

    Returns Promise<null>

  • Starts background tasks for all accounts.

    Returns Promise<null>

  • Stops background tasks for a single account.

    Parameters

    • accountId: number

    Returns Promise<null>

  • Stops background tasks for all accounts.

    Returns Promise<null>

  • Signal an ongoing process to stop.

    Parameters

    • accountId: number

    Returns Promise<null>

  • Parameters

    • accountId: number
    • contactId: number

    Returns Promise<null>

  • Waits for messages to be processed by the bot and returns their IDs.

    This function is similar to get_next_msgs, but waits for internal new message notification before returning. New message notification is sent when new message is added to the database, on initialization, when I/O is started and when I/O is stopped. This allows bots to use wait_next_msgs in a loop to process old messages after initialization and during the bot runtime. To shutdown the bot, stopping I/O can be used to interrupt pending or next wait_next_msgs call.

    Parameters

    • accountId: number

    Returns Promise<number[]>

Generated using TypeDoc