X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FTokenizedMessage.php;fp=app%2FTwitchBot%2FTokenizedMessage.php;h=f218e7ae9de89e8482bb0a2b6d0b1c92ff8eaab3;hb=c8a2f8ca5a615f5e07e35fb3926ef9d08ddb9cad;hp=72817c1dbc6066556f77e134684e74137d64f863;hpb=1dea58cb6fa9cf28966e75c1e1af87f67e6c0fd1;p=alttp.git diff --git a/app/TwitchBot/TokenizedMessage.php b/app/TwitchBot/TokenizedMessage.php index 72817c1..f218e7a 100644 --- a/app/TwitchBot/TokenizedMessage.php +++ b/app/TwitchBot/TokenizedMessage.php @@ -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':