diff options
author | Indrajith K L | 2021-10-19 01:19:31 +0530 |
---|---|---|
committer | Indrajith K L | 2021-10-19 01:19:31 +0530 |
commit | 26473671ebb370184936d68584106488dfeee895 (patch) | |
tree | 52a3ba4062736cb7616afc0554a2e16b5bdc174c /src/main.js | |
parent | b9a412237dd53eddf36df526d8580d27f689a6fd (diff) | |
download | lul-bot-26473671ebb370184936d68584106488dfeee895.tar.gz lul-bot-26473671ebb370184936d68584106488dfeee895.tar.bz2 lul-bot-26473671ebb370184936d68584106488dfeee895.zip |
language changes
Diffstat (limited to 'src/main.js')
-rw-r--r-- | src/main.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.js b/src/main.js index 9468832..58be588 100644 --- a/src/main.js +++ b/src/main.js @@ -52,7 +52,17 @@ function initLanguages() { function parseCasualMessage(message) { const { content } = message; const parsedMessage = content.trim().toLowerCase(); - if (!casualMessages.hasOwnProperty(parsedMessage)) return null; + if (!casualMessages.hasOwnProperty(parsedMessage)) { + let currentKey; + parsedMessage.split(" ").forEach((lang) => { + if(casualMessages.hasOwnProperty(lang)) { + currentKey = lang; + } + break; + }) + + return currentKey; + } return casualMessages[parsedMessage]; } |