aboutsummaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
authorIndrajith K L2021-10-19 01:19:31 +0530
committerIndrajith K L2021-10-19 01:19:31 +0530
commit26473671ebb370184936d68584106488dfeee895 (patch)
tree52a3ba4062736cb7616afc0554a2e16b5bdc174c /src/main.js
parentb9a412237dd53eddf36df526d8580d27f689a6fd (diff)
downloadlul-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.js12
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];
}