Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement /newtask #32

Open
Tracked by #17
Keyrxng opened this issue Nov 4, 2024 · 3 comments · May be fixed by #31
Open
Tracked by #17

Implement /newtask #32

Keyrxng opened this issue Nov 4, 2024 · 3 comments · May be fixed by #31

Comments

@Keyrxng
Copy link
Member

Keyrxng commented Nov 4, 2024

A new admin controlled command that allows the creation of GitHub tasks direct from telegram.

  • available to use in any type of chat
  • only available to use by admins of the bot
  • An admin must reply directly to the message they want to convert into a task

We lack the same context that we do on GitHub so it's required that the invoker pass in the repository.full_name (ubiquity-os-marketplace/ubiquity-os-kernel-telegram) so that we deliver the issue to the correct repo. This makes sense as admins will know immediately where they'd want it opened.

@0x4007
Copy link
Member

0x4007 commented Nov 4, 2024

Should be inlined "inline function" as we discussed before.

@Keyrxng
Copy link
Member Author

Keyrxng commented Nov 4, 2024

I don't think anything will be ported. Inline message seems quite different.

I will implement as I first suggested and you can see how it looks and we'll take it from there re: creating new chats from user comments.

I spent an hour reading through inline docs etc last night to try implement repo name autocomplete.

https://core.telegram.org/bots/api#inline-mode
https://core.telegram.org/bots/inline

I think you want to type @ubiquitos and then it pop up an inline modal only you can see and then you press a button or type newtask and it 'runs' this logic, is that right?

  1. The inline update the server receives won't have context on which message you want. It's purpose is to post something into the chat like a gif, document, link etc.
  2. It might capture the message ctx if you initiate a direct reply and then try to use @ubiquityos but they seem like separate features, I had to enable inline mode via the botfather and haven't explored it much.

I'll attempt to implement it, showing why it cannot be done if that's the case and we'll take it from there.

@Keyrxng
Copy link
Member Author

Keyrxng commented Nov 4, 2024

This is the trouble with the inline query; it's that we don't know which comment you are referring to even when direct replying and then mentioning the bot as the update doesn't reference it.

image

Inline query results are delivered in a fire-and-forget fashion. In other words, after your bot sent the list of inline query results to Telegram, it will not know which result the user picked (or if they picked one at all).

The above means that somehow we'd need to capture the original message and then hoist that into the inline_query update and then persist that through the chain of inline_query updates as we need to select which org then which repo. So at least 3 inline_queries to chain after capturing the task inspo comment.

There are advanced parts of Grammy that allow branching and forking of different ctx and updates and splicing them but that's beyond reach atm, still a lot of learning involved with the APIs and the libs we are using. Two brand new APIs and two libs; one for MTProto, one for BotAPI.


Let's ship the feature as a command for V1 and a task can be dedicated to upgrading it to an 'inline function', as it'll require more research and quite a bit of work as mentioned above. Do you agree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants