Slack\ApiClient::getGroupByName PHP Method

getGroupByName() public method

Gets a group by its name.
public getGroupByName ( string $name ) : React\Promise\PromiseInterface
$name string The name of the group.
return React\Promise\PromiseInterface
    public function getGroupByName($name)
    {
        return $this->getGroups()->then(function (array $groups) use($name) {
            foreach ($groups as $group) {
                if ($group->getName() === $name) {
                    return $group;
                }
            }
            throw new ApiException('Group ' . $name . ' not found.');
        });
    }