Get a sender for a particular channel
@param string $channel
@return mixed|null
546344
public function getSender($channel)
    {
        return isset($this->senders[$channel]) ? $this->senders[$channel] : null;
    }
1341004
public function getChannelCfg($channel)
    {
        if (!isset($this->channels[$channel])) {
            throw new \Erebot\NotFoundException('No such channel');
        }
        return $this->channels[$channel];
    }
310549
public function channel($channel)
    {
        $channel = $this->client->get(config('twitch-api.api_url') . '/kraken/channels/' . $channel);

        return $channel->json();
    }
94303
public function setChannel($channel)
    {
        $this->removeTarget();

        if ($channel) {
            $this->channel = (string) $channel;
        }

        return $this;
    }
612670
public function getChanContents(int $channel=1) : string
    {
        if ( ! isset ($this->pipes[$channel]))
            throw new \InvalidArgumentException("No channel '$channel' defined.");
        return $this->pipes[$channel];
    }
465915
protected function get($name)
    {
        return $this->channels[$name] ?? with($this->resolve($name), function ($driver) use ($name) {
            return new SMSSender($driver);
        });
    }
1323515
public function stopChannel($channel)
    {
        $op = $this->sendStopChannelOperation($channel);

        // waiting for create operation finishes
        $op = $this->awaitOperation($op);

        // true if succeeded
        return $op->getState() == OperationState::Succeeded;
    }
1069284
public static function getChannelDisplayName($channel)
    {
        $text = new Text();
        switch ($channel) {
            case self::CHANNEL_APPLICATION:
                return tc('Log channel', 'Application');
            case self::CHANNEL_AUTHENTICATION:
                return tc('Log channel', 'Authentication');
            case self::CHANNEL_EMAIL:
                return tc('Log channel', 'Sent Emails');
            case self::CHANNEL_EXCEPTIONS:
                return tc('Log channel', 'Exceptions');
            case self::CHANNEL_SECURITY:
                return tc('Log channel', 'Security');
            case self::CHANNEL_PACKAGES:
                return tc('Log channel', 'Packages');
            case self::CHANNEL_SPAM:
                return tc('Log channel', 'Spam');
            case self::CHANNEL_SITE_ORGANIZATION:
                return tc('Log channel', 'Site Organization');
            case self::CHANNEL_USERS:
                return tc('Log channel', 'Users');
            case self::CHANNEL_API:
                return tc('Log channel', 'API');
            default:
                return tc('Log channel', $text->unhandle($channel));
        }
    }
70859
final public function listen(string $channel): Promise
    {
        if (! $this->handle) {
            throw new FailureException('Not connected');
        }

        return $this->send("listen", $channel);
    }
1139612
public function getChannel(string $channel): Channel
    {
        if (!$this->channelExists($channel)) {
            throw new OutOfRangeException("The channel[{$channel}] not found");
        }

        return $this->channels[$channel];
    }
501143
public static function getLogger(string $channel): Logger
    {
        if (empty(static::$loggers[$channel])) {
            static::$loggers[$channel] = new Logger($channel);
        }

        return static::$loggers[$channel];
    }
252769
public function channelSubscriptionUser($channel, $user, $token = null)
    {
        return $this->sendRequest('GET', 'channels/'.$channel.'/subscriptions/'.$user, $this->getToken($token));
    }
1290985
private function _StreamStreamCallFactory($channel)
    {
        if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
            return function ($method,
                             $deserialize,
                             array $metadata = [],
                             array $options = []) use ($channel) {
                return $channel->getInterceptor()->interceptStreamStream(
                    $method,
                    $deserialize,
                    $metadata,
                    $options,
                    $this->_StreamStreamCallFactory($channel->getNext())
                );
            };
        }
        return $this->_GrpcStreamStream($channel);
    }
990027
public static function deregister($channel = null)
    {
        if (empty($channel)) {
            self::$loggers = [];

            return true;
        }
        if (isset(self::$loggers[$channel])) {
            unset(self::$loggers[$channel]);

            return true;
        }

        return false;
    }
391195
private function _UnaryUnaryCallFactory($channel)
    {
        if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
            return function ($method,
                             $argument,
                             $deserialize,
                             array $metadata = [],
                             array $options = []) use ($channel) {
                return $channel->getInterceptor()->interceptUnaryUnary(
                    $method,
                    $argument,
                    $deserialize,
                    $metadata,
                    $options,
                    $this->_UnaryUnaryCallFactory($channel->getNext())
                );
            };
        }
        return $this->_GrpcUnaryUnary($channel);
    }
1235016
public function getPrivateChannel()
    {
        $deferred = new Deferred();

        if ($this->cache->has("pm_channel.{$this->id}")) {
            $deferred->resolve($this->cache->get("pm_channel.{$this->id}"));
        } else {
            $this->http->post('users/@me/channels', ['recipient_id' => $this->id])->then(function ($response) use ($deferred) {
                $channel = $this->factory->create(Channel::class, $response, true);
                $this->cache->set("pm_channel.{$this->id}", $channel);

                $deferred->resolve($channel);
            }, \React\Partial\bind_right($this->reject, $deferred));
        }

        return $deferred->promise();
    }
770227
public function convertChannelFromV1x($channel)
    {
        $channelMap = array(
            'connect.magentocommerce.com/community' => 'community',
            'connect.magentocommerce.com/core' => 'community'
        );
        if (!empty($channel) && isset($channelMap[$channel])) {
            $channel = $channelMap[$channel];
        }
        return $channel;
    }