if (Str::contains($rawText, ['hype'])) {
return 'hype';
}
+ if (Str::startsWith($rawText, 'o7') || Str::endsWith($rawText, 'o7') || Str::contains($rawText, 'salut')) {
+ return 'o7';
+ }
return 'unclassified';
}
return $pogs > 2;
}
+ private function checkForSalute(Channel $channel) {
+ $notes = $this->getNotes($channel);
+ $o7s = 0;
+ foreach ($notes['latest_msgs'] as $text) {
+ if (ChatLog::classify($text) == 'o7') {
+ ++$o7s;
+ }
+ }
+ return $o7s > 2;
+ }
+
private function contextualMsg(Channel $channel) {
$last = $this->getNote($channel, 'last_special');
if ($last != 'gg' && $this->checkForGG($channel)) {
$this->setNote($channel, 'last_special', 'pog');
return $this->randomOfClass($channel, 'pog');
}
+ if ($last != 'o7' && $this->checkForSalute($channel)) {
+ $this->setNote($channel, 'last_special', 'o7');
+ return $this->randomOfClass($channel, 'o7');
+ }
return false;
}