"use strict";

import { xml } from '@xmpp/client';
export const sendTextMessageWithTranslateTag = (client, stanzaMessage, source, customId) => {
  const id = customId || `get-translate-messsage:${Date.now().toString()}`;
  try {
    const message = xml('message', {
      to: stanzaMessage.roomJID,
      type: 'groupchat',
      id: id
    }, xml('data', {
      ...stanzaMessage,
      push: 'true'
    }), xml('body', {}, stanzaMessage.userMessage), xml('translate', {
      source: source
    }));
    client.send(message);
  } catch (error) {
    console.error('An error occurred while sending message:', error);
  }
};
//# sourceMappingURL=sendTextMessageWithTranslateTag.xmpp.js.map