]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/TokenizedMessage.php
add context to adlibs
[alttp.git] / app / TwitchBot / TokenizedMessage.php
index 72817c1dbc6066556f77e134684e74137d64f863..f218e7ae9de89e8482bb0a2b6d0b1c92ff8eaab3 100644 (file)
@@ -50,6 +50,11 @@ class TokenizedMessage {
        }
 
 
+       public function getText() {
+               return $this->text;
+       }
+
+
        public function contains($text) {
                return Str::contains($this->text, $text);
        }
@@ -286,7 +291,7 @@ class TokenizedMessage {
                                $this->classification = 'cmd';
                        } else if ($this->isShort() && ($this->hasTokenThatStartsOrEndsWith(['gg']) || $this->hasEmoteThatEndsWith(['gg']))) {
                                $this->classification = 'gg';
-                       } else if ($this->isShort() && $this->containsRaw(['glgl', 'glhf', 'goodluck', 'hfgl', 'vielglück'])) {
+                       } else if ($this->isShort() && ($this->containsRaw(['glgl', 'glhf', 'goodluck', 'hfgl', 'vielglück']) || $this->hasToken('gl'))) {
                                $this->classification = 'gl';
                        } else if ($this->hasToken(['danke', 'thanks', 'thx', 'ty']) && !$this->hasToken(['nah', 'nee', 'nein', 'no'])) {
                                $this->classification = 'thx';
@@ -348,9 +353,9 @@ class TokenizedMessage {
                                        $this->hasConsecutiveTokens(['how', 'much']) ||
                                        $this->hasConsecutiveTokens(['wie', 'viele'])
                                ) {
-                                       return ['yes', 'no', 'kappa', 'lol', 'wtf', 'number'];
+                                       return ['yes', 'no', 'kappa', 'wtf', 'number'];
                                }
-                               return ['yes', 'no', 'kappa', 'lol', 'wtf'];
+                               return ['yes', 'no', 'kappa', 'wtf'];
                        case 'rage':
                                return ['kappa', 'lol', 'rage'];
                        case 'wtf':