"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.sendTextMessageWithTranslateTag = void 0;
var _client = require("@xmpp/client");
const sendTextMessageWithTranslateTag = (client, stanzaMessage, source, customId) => {
  const id = customId || `get-translate-messsage:${Date.now().toString()}`;
  try {
    const message = (0, _client.xml)('message', {
      to: stanzaMessage.roomJID,
      type: 'groupchat',
      id: id
    }, (0, _client.xml)('data', {
      ...stanzaMessage,
      push: 'true'
    }), (0, _client.xml)('body', {}, stanzaMessage.userMessage), (0, _client.xml)('translate', {
      source: source
    }));
    client.send(message);
  } catch (error) {
    console.error('An error occurred while sending message:', error);
  }
};
exports.sendTextMessageWithTranslateTag = sendTextMessageWithTranslateTag;
//# sourceMappingURL=sendTextMessageWithTranslateTag.xmpp.js.map