lukefx / hubot-telegram

Hubot adapter for Telegram
MIT License
160 stars 42 forks source link

inline query support #32

Open freeseacher opened 8 years ago

freeseacher commented 8 years ago

according to latest api changes please add inline query support to your api https://core.telegram.org/bots/inline tnx!

lukefx commented 8 years ago

Yepp...on my to do list :) maybe today or tomorrow

On Tuesday, January 5, 2016, Aleksey Shirokih notifications@github.com wrote:

according to latest api changes please add inline query support to your api https://coretelegramorg/bots/inline tnx!

— Reply to this email directly or view it on GitHub https://github.com/lukefx/hubot-telegram/issues/32.

arcturial commented 8 years ago

Let me know if you need help on this @lukefx, might need to do some refactoring to support it with minimal code duplication.

lukefx commented 8 years ago

@arcturial yepp thx, first of all, what do you think for the inlineQuery initial request? https://core.telegram.org/bots/api#inlinequery we should manage the request within the telegrambot api and launch and event to the adapter? What do you think?

arcturial commented 8 years ago

All the telegrambot API does is interact with the getUpdate method and sends the result to the callback, so not sure it would be the best place to put the events. However, we can change the code at line 212 and 225 to call handleInlineQuery if the inline_query key is set and then abstracting all the "common tasks" into different methods.

lukefx commented 8 years ago

All the telegrambot API does is interact with the getUpdate method and sends the result to the callback, so not sure it would be the best place to put the events. However, we can change the code at line 212 and 225 to call handleInlineQuery if the inline_query key is set and then abstracting all the "common tasks" into different methods.

I was thinking a method to let user define what the bot should reply to the inlinquery, so yes, quick and dirty could be in the handleUpdate method add an if and check if the message starts with a "@" and then? send an event so you can catch it in a script and compose your reply...

Anyway, let's create a branch...and collaborate on it...code speak itself :smile:

freeseacher commented 8 years ago

the text will not starts with @ i had already seen it. instead of it you will have the inline_query object with text in it

ср, 6 янв. 2016 г. в 16:45, Luca Simone notifications@github.com:

All the telegrambot API does is interact with the getUpdate method and sends the result to the callback, so not sure it would be the best place to put the events. However, we can change the code at line 212 and 225 to call handleInlineQuery if the inline_query key is set and then abstracting all the "common tasks" into different methods.

I was thinking a method to let user define what the bot should reply to the inlinquery, so yes, quick and dirty could be in the handleUpdate method add an if and check if the message starts with a "@" and then? send an event so you can catch it in a script and compose your reply...

Anyway, let's create a branch...and collaborate on it...code speak itself [image: :smile:]

— Reply to this email directly or view it on GitHub https://github.com/lukefx/hubot-telegram/issues/32#issuecomment-169305868 .

lukefx commented 8 years ago

Ah ok...so how do we know if is an inline query? By the object's attributes?

33 I've created a branch for this...

arcturial commented 8 years ago

Teap, the object attributes we get in getUpdates are different. Like @freeseacher said, it will contain the inline_query key with the text of the command inside inline_query.query.

C3realGuy commented 7 years ago

any news on this? Would love to see that feature.