freeCodeCampGuam / FCCG-Cogs

3 stars 4 forks source link

GitHub Cog periodic updates #3

Open centipeda opened 7 years ago

centipeda commented 7 years ago

GitHub cog should periodically check repositories it's assigned for new pull requests, commits, and open issues.

Chovin commented 7 years ago

and provide digests of subscribed repos to subscribers (user/channel) every settable time period.

centipeda commented 7 years ago

Added a task to the bot's asyncio loop, will add command for setting interval to check and give out digests.

For "updates" to repos, how should that be managed?
I'm thinking of caching a version of each repository's most recent commits, PRs, issues, and basic information. Every time a check rolls around, the old version's compared to the new version, and if there's more information (or different information) then it's pinpointed and reported.
Caching the data raises the question of storage (if I do it it'll probably end up being in SQL), so I'm wondering if there's another way.
</rant>, night-o.

centipeda commented 7 years ago

...Or we could use webhooks. That sounds a lot easier.

centipeda commented 7 years ago

Speaking of webhooks... https://support.discordapp.com/hc/en-us/articles/228383668-Using-Webhooks

Using Discord's built-in webhooks could make the entire notification aspect doable from within Discord.

Chovin commented 7 years ago

I recommend looking at 26's Trigger cog for your asyncio task.

In fact, I recommend asking in Red's #coding channel and looking at Red's cogs for pretty much everything. It'd save everyone time in the long run instead of reinventing the wheel for everything