SHARE
TWEET

Untitled

Neable Jul 19th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Neable = require("../../neable_module/NeableCommands");
  2. module.exports.run = async (Brie, message, args) => {
  3.  
  4.     TextoOriginal = args.slice(0).join(" ");
  5.  
  6.     TextoOriginalArr = TextoOriginal.split(" ");
  7.  
  8.     palavrasIguais = []
  9.     palavrasSalvas = []
  10.  
  11.     TextoOriginalArr.map(palavra => {
  12.         palavra = palavra.toLowerCase()
  13.         if (palavra.length < 4) return;
  14.  
  15.         const array = Neable.ArrayFind(TextoOriginalArr, palavra)
  16.  
  17.         if (palavrasSalvas.includes(array.word)) return
  18.  
  19.         if (array.amount > 1) {
  20.  
  21.             let abreviada = "";
  22.  
  23.             vogais = ['a', 'e', 'i', 'o', 'u']
  24.  
  25.             for (let i of array.word) {
  26.                 if (vogais.includes(i)) {
  27.  
  28.                 } else {
  29.                     abreviada += (i)
  30.                 }
  31.             }
  32.  
  33.             sameWord = { word: array.word, amount: array.amount, location: array.location, abreviation: abreviada }
  34.  
  35.             palavrasSalvas.push(array.word)
  36.  
  37.             sameWord = JSON.stringify(sameWord)
  38.  
  39.             palavrasIguais.push(JSON.parse(sameWord))
  40.         }
  41.  
  42.     })
  43.  
  44.     console.log(palavrasIguais)
  45.     if (palavrasIguais.length > 0) {
  46.         message.channel.send(`Palvras iguais encontradas!`);
  47.  
  48.         let a = ""
  49.  
  50.         palavrasIguais.map(c => {
  51.             a += `${c.word} = ${c.abreviation}\n`
  52.  
  53.         })
  54.         let novoTexto = "";
  55.  
  56.         palavrasIguais = JSON.stringify(palavrasIguais, null, 2)
  57.         Neable.createEmbed(message, { description: `\`\`\`js\n${a}\`\`\`` })
  58.         Neable.createEmbed(message, { description: `\`\`\`js\n${TextoOriginal}\`\`\`` })
  59.     } else {
  60.         message.channel.send(`Nenhuma palavra igual encontrada.`);
  61.     }
  62. }
  63.  
  64. module.exports.help = {
  65.     name: 'texto',
  66.     type: undefined,
  67.     working: false
  68. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top