Get chat commands to display the admin.

@param ManialinkInterface $manialink

@return array
545439
protected function getChatCommands(ManialinkInterface $manialink)
    {
        $login = $manialink->getUserGroup()->getLogins()[0];

        return array_map(
            function ($command) {
                /** @var AbstractChatCommand $command */
                return [
                    'command' => $command->getCommand(),
                    'description' => $command->getDescription(),
                    'help' => $command->getHelp(),
                    'aliases' => $command->getAliases(),
                ];
            },
            array_filter(
                $this->chatCommands->getChatCommands(),
                function ($command) use ($login) {
                    if ($command instanceof AbstractAdminChatCommand) {
                        return $command->hasPermission($login);
                    }

                    return true;
                }

            )
        );
    }
112287
protected function callMatchingMessages()
    {
        $matchingMessages = $this->conversationManager->getMatchingMessages($this->getMessages(), $this->middleware,
            $this->getConversationAnswer(), $this->getDriver());

        foreach ($matchingMessages as $matchingMessage) {
            $this->command = $matchingMessage->getCommand();
            $callback = $this->command->getCallback();

            $callback = $this->getCallable($callback);

            // Set the message first, so it's available for middlewares
            $this->message = $matchingMessage->getMessage();

            $commandMiddleware = Collection::make($this->command->getMiddleware())->filter(function ($middleware) {
                return $middleware instanceof Heard;
            })->toArray();

            $this->message = $this->middleware->applyMiddleware('heard', $matchingMessage->getMessage(),
                $commandMiddleware);

            $parameterNames = $this->compileParameterNames($this->command->getPattern());

            $parameters = $matchingMessage->getMatches();
            if (\count($parameterNames) !== \count($parameters)) {
                $parameters = array_merge(
                //First, all named parameters (eg. function ($a, $b, $c))
                    array_filter(
                        $parameters,
                        '\is_string',
                        ARRAY_FILTER_USE_KEY
                    ),
                    //Then, all other unsorted parameters (regex non named results)
                    array_filter(
                        $parameters,
                        '\is_integer',
                        ARRAY_FILTER_USE_KEY
                    )
                );
            }

            $this->matches = $parameters;
            array_unshift($parameters, $this);

            $parameters = $this->conversationManager->addDataParameters($this->message, $parameters);

            if (call_user_func_array($callback, $parameters)) {
                return;
            }
        }

        if (empty($matchingMessages) && empty($this->getBotMessages()) && ! \is_null($this->fallbackMessage)) {
            $this->callFallbackMessage();
        }
    }
898553
public function getForumActions()
    {
        Container::get('hooks')->fire('model.index.get_forum_actions_start');

        $forum_actions = [];

        // Display a "mark all as read" link
        if (!User::get()->is_guest) {
            $forum_actions[] = '<a class="btn btn-primary btn-sm" href="'.
                Router::pathFor('markRead').'">'.__('Mark all as read').'</a>';
        }

        $forum_actions = Container::get('hooks')->fire('model.index.get_forum_actions', $forum_actions);

        return $forum_actions;
    }
444262
def get_chat_administrators(self, *args, **kwargs):
        """"""
        return get_chat_administrators(*args, **self._merge_overrides(**kwargs)).run()
1326089
public function execute(ManialinkFactory $manialinkFactory, ManialinkInterface $manialink, $login, $answerValues, $args)
    {
        $manialinkFactory->destroy($manialink->getUserGroup());
        $this->chatCommandProvider->onPlayerChat(
            $login,
            $login,
            $this->chatCommand,
            true
        );
    }
766703
public function getLanguageStrings($iLang = null, $blAdminMode = null)
    {
        $aLang = array();

        foreach ($this->_getLangTranslationArray($iLang, $blAdminMode) as $sLangKey => $sLangValue) {
            $aLang[$sLangKey] = $sLangValue;
        }

        foreach ($this->_getLanguageMap($iLang, $blAdminMode) as $sLangKey => $sLangValue) {
            $aLang[$sLangKey] = $sLangValue;
        }

        if (count($this->_aAdditionalLangFiles)) {
            foreach ($this->_getLangTranslationArray($iLang, $blAdminMode, $this->_aAdditionalLangFiles) as $sLangKey => $sLangValue) {
                $aLang[$sLangKey] = $sLangValue;
            }
        }

        return $aLang;
    }
600328
protected function getCommandDescriptions()
    {
        $commands = [];
        foreach ($this->getCommands() as $command) {
            $actions = [];
            $result = Yii::$app->createController($command);
            if ($result !== false && $result[0] instanceof \Hprose\Yii\Controller) {
                list($controller) = $result;
                /** @var Controller $controller */
                $actions = $this->getActions($controller);
            }

            $commands[$command] = $actions;
        }

        return $commands;
    }
436017
public function getEventMessageSites($messageId) {
        $dbres = \CEventMessage::GetLang($messageId);
        return $this->fetchAll($dbres, false, 'LID');
    }
1139554
public function getMessagesByCommand($commandUuid): array
    {
        $messagesByUuid = [];
        /** @var Message $message */
        foreach ($this->messages as $message) {
            if ($message->commandUuid === $commandUuid) {
                $messagesByUuid[] = $message;
            }
        }

        return $messagesByUuid;
    }
246637
protected function listCommands(CommandEvent $event, EventQueueInterface $queue)
    {
        $targets = $event->getTargets();
        $target = reset($targets);
        $nick = $event->getNick();

        if ($target === $event->getConnection()->getNickname()) {
            $target = $nick;
            $address = '';
        } else {
            $address = $nick . ': ';
        }

        $method = 'irc' . $event->getCommand();
        $message = $address . $this->listText . implode(' ', $this->commands);
        $queue->$method($target, $message);
    }
918154
public function setManialink(ManialinkInterface $manialink)
    {
        $this->manialink = $manialink;

        $this->actionFirstPage = $this->actionFactory
            ->createManialinkAction($manialink, array($this, 'goToFirstPage'), [], true);
        $this->actionPreviousPage = $this->actionFactory
            ->createManialinkAction($manialink, array($this, 'goToPreviousPage'), [], true);
        $this->actionNextPage = $this->actionFactory
            ->createManialinkAction($manialink, array($this, 'goToNextPage'), [], true);
        $this->actionLastPage = $this->actionFactory
            ->createManialinkAction($manialink, array($this, 'goToLastPage'), [], true);
        $this->actionGotoPage = $this->actionFactory
            ->createManialinkAction($manialink, array($this, 'goToPage'), [], true);

        return $this;
    }
1267997
public function getRelatedCommandIdentifiers(): array
    {
        $commandMethodReflection = $this->getCommandMethodReflection();
        if (!$commandMethodReflection->isTaggedWith('see')) {
            return [];
        }

        $relatedCommandIdentifiers = [];
        foreach ($commandMethodReflection->getTagValues('see') as $tagValue) {
            if (preg_match('/^[\w\.]+:[\w]+:[\w]+$/', $tagValue) === 1) {
                $relatedCommandIdentifiers[] = $tagValue;
            }
        }
        return $relatedCommandIdentifiers;
    }
8979
public function execute(ManialinkInterface $manialink, $login, $answerValues)
    {
        call_user_func_array($this->callable, [$manialink, $login, $answerValues, $this->args]);
    }
479315
public function getEventTalks($eventId, array $options = array()) {
        $talks = $this->runCommand(
            'event.talks.get',
            array('eventId' => $eventId),
            $options
        );

        return $this->assignIdsFromUri($talks);
    }
709453
public function goToFirstPage(ManialinkInterface $manialink, $login = null, $entries = [])
    {
        $this->updateDataCollection($entries);
        $this->changePage(1);
    }
261442
protected function serializeLink(LinkInterface $link)
    {
        if (!$link->metaInformation()->isEmpty()) {
            return [
                'href' => $link->href(),
                'meta' => $link->metaInformation()->all(),
            ];
        }

        return $link->href();
    }
1108246
protected function buildConfig(ConfigInterface $config, $sizeX, ManialinkInterface $manialink)
    {
        $rowLayout = $this->uiFactory->createLayoutRow(2, 0, [], 1);

        $rowLayout->addChild(
            $name = $this->uiFactory
                ->createLabel($config->getName(), Label::TYPE_TITLE)
                ->setWidth($sizeX)
                ->setHorizontalAlign(Control::LEFT)
                ->setTranslate(true)
                ->setTextId($config->getName())
                ->setText(null));

        if ($config->getDescription()) {
            $rowLayout->addChild(
                $this->uiFactory
                    ->createLabel("", Label::TYPE_NORMAL)
                    ->setWidth($sizeX)
                    ->setHorizontalAlign(Control::LEFT)
                    ->setTranslate(true)
                    ->setTextId($config->getDescription())
                    ->setText(null)
                    ->setTextPrefix("  ")
                    ->setMaxLines(3)
                    ->setLineSpacing(1)
            );
        }

        $rowLayout->addChild(
            $this->configUiManager->getUiHandler($config)->build($config, $sizeX * 0.37, $manialink, $this)
        );


        return $rowLayout;
    }