/** * @return bool|null */ public function isGroupChatMessage() { if ($this->from->getId() != $this->user->getId()) { return true; } else { return false; } }
/** * @param \Steelbot\ClientInterface $client * @param OutgoingPayloadInterface|string $payload * * @return \Generator */ public function send(ClientInterface $client, OutgoingPayloadInterface $payload) : \Generator { // convert standard text message to telegram text message if ($payload instanceof TextMessage) { $payload = new TelegramTextMessage($payload->getText()); } if ($payload instanceof TelegramTextMessage) { /** @var TelegramTextMessage $payload */ return $this->api->sendMessage($client->getId(), $payload->getText(), $payload->getParseMode(), $payload->getDisableWebPagePreview(), $payload->getDisableNotification(), $payload->getReplyToMessageId(), $payload->getReplyMarkup()); } /* elseif ($payload instanceof ImageMessage) { return $this->api->sendPhoto($client->getId(), $payload->getResource(), null, null, null); } */ throw new \DomainException("Unknown payload type"); }