You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I successfully implemented Inline Queries Driver in my project and I would like to make PR to this repo but I need some advices about how to do it properly to meet the package requirements.
So the steps are:
To create TelegramInlineQueryDriver class [DONE]
Write matching logic [DONE]
public function matchesRequest()
{
return ! is_null($this->payload->get('inline_query'));
}
Check that other driver will not match inline_query (TelegramDriver itself)
Here is the interesting part. Need to decide how TelegramInlineQueryDriver sends request to Telegram API.
Because inline queries don't use Conversations/Messages - we just need to send response directly.
In my project I've created buildServicePayloadInline instead of buildServicePayload method in TelegramInlineQueryDriver. buildServicePayloadInline will switch to answerInlineQuery endpoint:
So now I'm wondering the most about "//forming $arArticlesJson array" part. We don't have Conversation classes here. But we need to inject our logic to prepare data that will be sent.
The most primitive way I see is for example to do that just by static method with closure:
I successfully implemented Inline Queries Driver in my project and I would like to make PR to this repo but I need some advices about how to do it properly to meet the package requirements.
So the steps are:
Check that other driver will not match inline_query (TelegramDriver itself)
Here is the interesting part. Need to decide how TelegramInlineQueryDriver sends request to Telegram API.
Because inline queries don't use Conversations/Messages - we just need to send response directly.
In my project I've created buildServicePayloadInline instead of buildServicePayload method in TelegramInlineQueryDriver. buildServicePayloadInline will switch to answerInlineQuery endpoint:
So now I'm wondering the most about "//forming $arArticlesJson array" part. We don't have Conversation classes here. But we need to inject our logic to prepare data that will be sent.
The most primitive way I see is for example to do that just by static method with closure:
What are your ideas on this, dear colleagues?
The text was updated successfully, but these errors were encountered: