Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Enable /commands in private messages #41

Open
0x4007 opened this issue Sep 26, 2023 · 11 comments
Open

Enable /commands in private messages #41

0x4007 opened this issue Sep 26, 2023 · 11 comments

Comments

@0x4007
Copy link
Member

0x4007 commented Sep 26, 2023

Instead of us having to use https://github.com/ubiquibot/production/issues for generic bot commands (like right now I was about to use /query let us use the commands in Telegram directly in a DM.

@PhantomCracker
Copy link
Contributor

Hei @pavlovcik ,
I do not really understand what are we using right now... Can you provide more details please?

Thanks, please assign this issue to me.

@0x4007
Copy link
Member Author

0x4007 commented Aug 27, 2024

Do you guys think its straightforward to route commands from Telegram to our plugins and then return their output in Telegram? I'm assuming yes but I would like to hear input from who worked on the kernel and plugins.

@Keyrxng @gentlementlegen @whilefoo rfc

@Keyrxng
Copy link
Contributor

Keyrxng commented Aug 27, 2024

No I don't think it's super straight forward, some plugins we'll have much easier success with such as /query.

  • if we use a slashCommand the plugin needs to support seeing the bot as the commenter and then processing it for the user tagged such as /start @keyrxng
  • we do not know the plugin config settings without parsing the whole org config file and rinsing it sort of like the kernel does
  • The kernel and it's plugins all expect a perfect GH webhook payload. So we'd need to craft those for each event unless we actually trigger the event instead of trying to bypass it. So are we firing REST API calls and triggering or using the slash command?
  • If we are targeting the plugin workers/workflows directly then they might need to be adjusted so that they return the plugins result (I'm not sure all do)

I had a small think on this but there are a lot of assumptions I've made that I'd need to test out

@0x4007
Copy link
Member Author

0x4007 commented Aug 27, 2024

We don't need to roll out 100% support, but yes the idea was to eventually use it for commands like /query, maybe /wallet.

@0x4007
Copy link
Member Author

0x4007 commented Aug 27, 2024

/help

Copy link

ubiquity-os bot commented Aug 27, 2024

Available Commands

Command Description Example
/help List all available commands. /help
/allow Allows the user to modify the given label. /allow @user1 label
/query Returns the user's wallet, access, and multiplier information. /query @ubiquibot
/start Assign yourself to the issue. /start
/stop Unassign yourself from the issue. /stop
/wallet Register your wallet address for payments. /wallet ubq.eth

@Keyrxng
Copy link
Contributor

Keyrxng commented Aug 27, 2024

/wallet and /query would be easy enough but it would be easier in my opinion to build the underlying logic into the telegram side than to actually have the bot comment /wallet and then parse the response from the comment and send it back or hitting the plugin worker directly. So those commands would perform the same thing but exist as TG slash commands.

@0x4007
Copy link
Member Author

0x4007 commented Aug 27, 2024

The purpose of direct messaging the bot is to minimize unnecessary notifications for everyone so that approach is unacceptable.

@whilefoo
Copy link

The first problem is that kernel wouldn't know which plugin to call for a specific command because it doesn't have a config, unless we hardcode certain commands which is fine because at Telegram will have its own entry point in the kernel and won't interfere with other code.

If the plugin that handles the command doesn't rely on Github it would work but most plugins do, for example /wallet needs Github user's ID to register the wallet, so unless we create a way to connect Github and Telegram accounts it's not feasible.

/query plugin also uses Github to check if a user is allowed to query someone else and posts a comment so you would need to create a separate entry point in the plugin only for Telegram.

@0x4007
Copy link
Member Author

0x4007 commented Aug 28, 2024

We had an early prototype that would allow you to pair your GitHub account with your Telegram account using oauth authentication.

@Keyrxng
Copy link
Contributor

Keyrxng commented Nov 1, 2024

@0x4007 Is this a goal for V2, implementing our GitHub slash commands into private chat commands?

We should archive this repo

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

No branches or pull requests

4 participants