-
Notifications
You must be signed in to change notification settings - Fork 33
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
Telegram DM Rewards #73
Comments
@Keyrxng so you think this would be easy? We can look for new comments posted and check if it's the rewards and forward it or something? Alternatively we can bake it inside of the rewards generation logic in some config. |
Yeah this is a great idea, it's easy to lose permits I think lmao.
It's easy if we are using Supabase, otherwise JSON storage implementation required. Since we're pushing for that I'll think in those terms. Ideally we migrate the current userDB into a streamlined version so we can easily map telegram accounts to Github accounts. Then we ensure it cannot be written to by anyone other than the bot. It should be two-way like so: GitHub Slash Command: The commands would need a pseudo 2FA process like:
similarly
Or we build an actual OAuth flow that allows login-with-github and We could do it without this 2FA I guess... JSON storage won't be required to have unique IDS etc so it's possible for a bad actor to insert entries that map to incorrect accounts. They can't do anything with the reward URLs anyway so it's not a real issue in that sense, but it's easy to bot TG (pun intended) and I could see our JSON storage being spammed to the point it's unusable or needs split across a few instances. But I expect that we'll have other features down the line that would benefit from account validation so I'd build with that in mind. Yeah there a few options I guess
|
Honestly, I think just opting in on the Telegram side is sufficient. Lets just do that. For example, I tell the bot to forward me all permits generated for @0x4007 Technically I can subscribe to get all @Keyrxng permits forwarded as well, it doesn't matter. I get no value from it so I won't. But who knows, maybe it could be useful to keep an eye on specific contributors. |
I think this plugin can be made more generic to be able to register a telegram account and listen to multiple events, then forward that to the telegram account. We could have this as its own plugin, that could be added to plugin chains, which could allow any plugin to send their payloads and notifications, that would be forwarded. Example: And then I would receive on telegram notifications when I get a reward, when I am un-assigned or when I get a reminder on some task. |
I think thats a really cool idea. Isn't that complicated to set up from an architecture standpoint? RFC @gentlementlegen @Keyrxng |
So this is a GitHub-side pairing of accounts and we already have spoken about a Telegram sided pairing event, both right now are intended solely for personalised notifications. Why don't we build a plugin which is just for these types of personalized/individual notifications, which can be extended to cover almost anything within reason.
type UserStorage = {
githubUsername: string; // redundancy against the occasional mismatch between login and name mentlegen knows
githubId: number;
telegramUsername: string;
telegramId: number;
wallet: string;
notifyOn: {
rewards: Optional<boolean>;
reminders: Optional<boolean>;
unassignment: Optional<boolean>;
...
}
Most we could probably do through comment parsing but it seems fragile since those change often, but with the comment metadata read/write standardized maybe this is a good approach for those that can support it? All-in-all. We need storage first. Then a way to register (not tied to any specific plugin as a lot of telegram features need this info). Then for each intended notification, decide how to collect that event as typically we'll want the output of the plugin, not the event which starts it. e.g We could add logic to be able to watch other user events but I think we should focus on just your own personalized notifications for now. |
Just opt on telegram side no auth needed don't need to make it more complicated than it needs to be. You can set up your own Supabase and use it for storage. I imagine a plugin author can have a single Supabase instance with multiple tables for multiple plugins |
I think that the plugin could have its own DB (doesn't matter supabase github wherever that can store data) and I think all it would need is to link a GitHub account with a telegram + events. The risk I see is that you could link any telegram handle so maybe we should add a verification somethow (imagine I register to all the events but I put your handle so you get spam for no reason). |
Since we are going to be providing official plugins then does this apply to us also? Where we'd have a singular or multiple dedicated plugin DBs? A lot of the telegram features are going to need to use this user mapping that we are creating so we should think in terms of it being accessible by more than just this plugin imo.
If we use the TG id as the primary then a user could receive any number of GH handle updates but they cannot be registered to receive spam like in your example. |
When things are totally stable we can manage a migration to a "Ubiquity Official" Supabase instance. That is a much lower priority because it just slows down development vs developers having their own instances I think. However, as I keep going on about, the optimal storage solution is git based. Then every developer has immediate access to the "database"
Upon entering the slash command to the Telegram bot, consider doing a GitHub user id lookup and save that instead. |
@0x4007 Are you happy to close this? |
Why would we close this? |
I've built
|
|
Perhaps its more convenient for a Telegram bot to message the rewards. This module can come with a registration command1 and then direct message the reward link.
This could be more convenient to some users until we finish the database side and collect all the unclaimed rewards for the contributors.
Footnotes
/telegram pavlovcik ↩
The text was updated successfully, but these errors were encountered: