mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 14:21:41 +02:00
Make Temmie Translator More of a NPM Module of it's own
This commit is contained in:
@@ -143,7 +143,7 @@ function isLetter(character) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const translator = function(text) {
|
function translator(text) {
|
||||||
let translatedText = "";
|
let translatedText = "";
|
||||||
let word = "";
|
let word = "";
|
||||||
for (let i = 0; i < text.length; i += 1) {
|
for (let i = 0; i < text.length; i += 1) {
|
||||||
@@ -164,6 +164,13 @@ const translator = function(text) {
|
|||||||
if (word !== "") translatedText += translateWord(word);
|
if (word !== "") translatedText += translateWord(word);
|
||||||
|
|
||||||
return translatedText;
|
return translatedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
const temmize = function(text) {
|
||||||
|
let currentTranslation = translator(text);
|
||||||
|
let temmify = currentTranslation.split("ing").join("in").split("!").join("!!!!111!11!1!!!1!!!1111!").split("'").join("");
|
||||||
|
|
||||||
|
return temmify;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -184,11 +191,7 @@ module.exports = class TemmieCommand extends commando.Command {
|
|||||||
}
|
}
|
||||||
console.log("[Command] " + message.content);
|
console.log("[Command] " + message.content);
|
||||||
let thingToTranslate = message.content.split(" ").slice(1).join(" ");
|
let thingToTranslate = message.content.split(" ").slice(1).join(" ");
|
||||||
let temspeak = translator(thingToTranslate);
|
let temmized = temmize(thingToTranslate);
|
||||||
let noing = temspeak.split("ing").join("in");
|
message.channel.send(temmized);
|
||||||
let noExclaim = noing.split("!").join("!!!!111!11!1!!!1!!!1111!");
|
|
||||||
let noApostrophe = noExclaim.split("'").join("");
|
|
||||||
let translated = noApostrophe;
|
|
||||||
message.channel.send(translated);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user