text: /* 
  */
  
  
  const XTroid = require('../events');
  const ffmpeg = require('fluent-ffmpeg');
  const fs = require('fs');
  const https = require('https');
  const googleTTS = require('google-translate-tts');
  const { MessageType, Mimetype, MessageOptions } = require('@adiwajshing/baileys');
  const Language = require('../language');
  const Lang = Language.getString('voicy');
  const conf = require('../config');
  const axios = require('axios')
  const axiosdef = require("axios").default;
  const os = require('os')
  const translatte = require('translatte');
  const LanguageDetect = require('languagedetect');
  const lngDetector = new LanguageDetect();
  const Heroku = require('heroku-client');
  const heroku = new Heroku({
      token: conf.HEROKU.API_KEY
  });
  let baseURI = '/apps/' + conf.HEROKU.APP_NAME;
  
  let wk = conf.WORKTYPE == 'public' ? false : true
  var vtalk_dsc = ''
  var reply_eva = ''
  
  const recognizeAudio = () => {
      const headers = new Headers({
          'Content-Type': 'audio/wav',
          "Authorization": `Bearer ${conf.WITAI_API}`,
          'Cache-Control': 'no-cache',
          'Transfer-Encoding': 'chunked'
      })
      const requestBody = {
          method: "POST",
          body: fs.readFileSync('output.wav'),
          headers: headers
      }
      return fetch("https://api.wit.ai/speech?v=20200219", requestBody)
          .then(response => response.lasijson())
          .then(lasijson => lasijson._text)
  }
  const convertToWav = file => {
      return ffmpeg(file)
          .audioCodec('pcm_s16le')
          .format('wav')
          .save('output.wav')
  }
  
  XTroid.addCMD({on: 'text', fromMe: wk, dontAddCMDList: true, deleteCommand: false}, (async (message, match) => {
      if (message.message.startsWith('Trex') && conf.AILIZA !== 'true') {        
          var unique_ident = message.client.user.jid.split('@')[0]      
          var finm = message.message.replace('Trex', '').replace(' ', '')   
          var ldet = lngDetector.detect(finm)
          var trmsg = finm
  
          var uren = encodeURI(trmsg)
          await axios.get('http://api.brainshop.ai/get?bid=157582&key=HzYiQOTcF1zOB0cs&uid=' + unique_ident + '&msg=' + uren).then(async (response) => {
              var fins = ''                           
              if (conf.LANG !== 'EN') {
                  ceviri = await translatte(response.data.cnt, {from: 'auto', to: conf.LANG});
                  if ('text' in ceviri) {
                      fins = ceviri.text
                  }
              } else { fins = response.data.cnt }
              await message.client.sendMessage(message.jid,fins, MessageType.text, { quoted: message.data})
          })
      }
  }));
  