+ $text = $msg->getText();
+ if ($text[0] == '!') {
+ $this->handleChatCommand($channel, $msg);
+ } else if (
+ $channel->isAcceptingGuesses() &&
+ !empty($msg->tags['user-id']) &&
+ !empty($msg->tags['display-name'] &&
+ $channel->isValidGuess($text))
+ ) {
+ $uid = 't:'.$msg->tags['user-id'];
+ $uname = $msg->tags['display-name'];
+ try {
+ $channel->registerGuess($uid, $uname, $text);
+ } catch (\Exception $e) {
+ $this->getLogger()->warning('error registering guess "'.$text.'" on channel '.$channel->title.': '.$e->getMessage());
+ }
+ }