Cleans the text from mentions, by providing a context message.
@param \CharlotteDunois\Yasmin\Models\Message  $message
@param string                                  $text
@return string
933
static function cleanContent(\CharlotteDunois\Yasmin\Models\Message $message, string $text) {
        /** @var \CharlotteDunois\Yasmin\Interfaces\ChannelInterface  $channel */
        foreach($message->mentions->channels as $channel) {
            $text = \str_replace('<#'.$channel->getId().'>', '#'.$channel->name, $text);
        }
        
        /** @var \CharlotteDunois\Yasmin\Models\Role  $role */
        foreach($message->mentions->roles as $role) {
            $text = \str_replace($role->__toString(), $role->name, $text);
        }
        
        /** @var \CharlotteDunois\Yasmin\Models\User  $user */
        foreach($message->mentions->users as $user) {
            $guildCheck = ($message->channel instanceof \CharlotteDunois\Yasmin\Interfaces\GuildChannelInterface && $message->channel->getGuild()->members->has($user->id));
            $text = \preg_replace('/<@!?'.$user->id.'>/', ($guildCheck ? $message->channel->getGuild()->members->get($user->id)->displayName : $user->username), $text);
        }
        
        return $text;
    }
42967
public function replacePlaceholders($message, $values = array())
    {
        $length = count($values);
        $i = 1;
        foreach ($values as $value) {
            if (is_array($value)) {
                $message = preg_replace_callback('/%' . $i . '\{(.*?)\}\{(.*?)\}/', function ($matches) use ($value) {
                    $length = count($value);
                    $list = '';
                    for ($i = 0; $i < $length; $i ++) {
                        $list .= $value[$i];
                        if ($i != ($length - 1)) {
                            if ($i == ($length - 2)) {
                                $list .= $matches[2];
                            } else {
                                $list .= $matches[1];
                            }
                        }
                    }
                    return $list;
                }, $message);
            } else {
                $message = str_replace('%' . $i, $value, $message);
            }
            $i ++;
        }
        return $message;
    }
292300
public function gettext($message) {
		if (strlen($message) === 0) {
			return $message;
		}
		if ($this->reader === null) {
			return $message;
		}
		return $this->reader->translate((string)$message);
	}
5861
public function clean($text)
    {
        $len = $this->utf8 ? mb_strlen($text) : strlen($text);

        if ($len <= $this->max) {
            return $text;
        }

        return $this->utf8 ? mb_substr($text, 0, $this->max) : substr($text, 0, $this->max);
    }
433381
protected function handleMessage($message)
    {
        if (!is_null($response = $this->call('message.*', array($message)))) {
            return $response;
        }

        return $this->call("message.{$message['MsgType']}", array($message));
    }
879110
public static function clearTextAllowedTags(string $text = null) : string
    {
        if (is_null($text)){
            return '';
        }
        return strip_tags(trim($text), '<p><a><strong><em><ul><li><ol><h1><h2><h3>');
    }
154169
public static function normalizeText($text)
    {
        $text = strtolower($text);
        $text = preg_replace('/[^a-z0-9 -]/im', ' ', $text);
        $text = preg_replace('/( +)/im', ' ', $text);

        return trim($text);
    }
1069376
public function logMessage(Message $message) {
        foreach($this->logger as $logger) {
            $logger->logMessage($message);
        }
    }
960010
def strip_mentions_links(self, text):
        
        #print 'Before:', text
        new_text = [word for word in text.split() if not self.is_mention_line(word)]
        #print 'After:', u' '.join(new_text)
        return u' '.join(new_text)
377194
public function sms($phone, $message = null) {
        $phone = 'sms:'.$phone;
        if (!is_null($message)) {
            $phone .= ':'. $message;
        }
        return $this->encode($phone);
    }
1132628
public static function clearText(string $text = null) : string
    {
        if (is_null($text)){
            return '';
        }
        return strip_tags(trim($text));
    }
572280
public static function clearMsg($msg)
    {
        $nmsg = str_replace([' standalone="no"', 'default:', ':default', "\n", "\r", "\t"], '', $msg);
        $nnmsg = str_replace('> ', '>', $nmsg);
        if (strpos($nnmsg, '> ')) {
            $nnmsg = self::clearMsg((string) $nnmsg);
        }

        return $nnmsg;
    }
802874
public function getMentions($text) {
    $mentions = [];
    $config_names = $this->mentionTypes;

    foreach ($config_names as $config_name) {
      $settings = $this->config->get('mentions.mentions_type.' . $config_name);
      $input_settings = [
        'prefix' => $settings->get('input.prefix'),
        'suffix' => $settings->get('input.suffix'),
        'entity_type' => $settings->get('input.entity_type'),
        'value' => $settings->get('input.inputvalue'),
      ];
      $this->inputSettings[$config_name] = $input_settings;

      if (!isset($input_settings['entity_type']) || empty($this->settings['mentions_filter'][$config_name])) {
        continue;
      }

      $output_settings = [
        'value' => $settings->get('output.outputvalue'),
        'renderlink' => (bool) $settings->get('output.renderlink'),
        'rendertextbox' => $settings->get('output.renderlinktextbox'),
      ];
      $this->outputSettings[$config_name] = $output_settings;
      $mention_type = $settings->get('mention_type');
      $mention = $this->mentionsManager->createInstance($mention_type);

      if ($mention instanceof MentionsPluginInterface) {
        $pattern = '/(?:' . preg_quote($input_settings['prefix']) . ')([a-zA-Z0-9_]+)' . preg_quote($input_settings['suffix']) . '/';
        preg_match_all($pattern, $text, $matches, PREG_SET_ORDER);

        foreach ($matches as $match) {
          $target = $mention->targetCallback($match[1], $input_settings);

          if ($target !== FALSE) {
            $mentions[$match[0]] = [
              'type' => $mention_type,
              'source' => [
                'string' => $match[0],
                'match' => $match[1],
              ],
              'target' => $target,
              'config_name' => $config_name,
            ];
          }
        }
      }
    }

    return $mentions;
  }
968926
public function notice($message, array $context = array())
    {
        if (self::isSetLogger()) {
            return self::$logger->notice($message, $context);
        }

        return false;
    }
251268
public function skip($message = '')
    {
        if ($this->skipped !== true) {
            $this->skipped = true;
            $this->skipped_because = $message;
        }

        return $this;
    }
676297
protected function cleanText($text)
    {
        $strippedText = strip_tags($text);
        $strippedText = htmlentities($strippedText, ENT_QUOTES, $this->getCharset(), FALSE);
        return html_entity_decode($strippedText, ENT_QUOTES, $this->getCharset());
    }
687422
public function notice($message, array $context = array())
    {
        if ($this->logger) {
            $context = $this->getLoggerContext($context);

            $this->logger->notice($message, $context);
        }
    }