obsproject / obs-bot

Source code for the obsproject Discord bot
https://discord.gg/obsproject
GNU General Public License v3.0
38 stars 18 forks source link

cogs.utils.github Add embed formatting for github issue webhooks #12

Closed asher-the-thrasher closed 2 years ago

asher-the-thrasher commented 2 years ago

Description

This makes the commit channel issue embed look nicer using the forced new issues format. It uses the markdown header text ### and makes that line a new field title and everything after the description of the new field until the next header text. This can probably be applied to prs as well but I haven't had the time to look into it yet as I will probably want to add some more formatting for prs.

some notes:

example: image

Motivation and Context

I decided this would be nice to have after being annoyed seeing the unformatted markdown in the bot messages.

How Has This Been Tested?

This will require brief testing on an obs bot build as I only tested it based on a copy of the relevant info on another bot. It should work correctly but testing never hurts.

Types of changes

Checklist:

Fenrirthviti commented 2 years ago

Can this be applied to PRs as well? Or is it already?

asher-the-thrasher commented 2 years ago

I made it so that it would work with prs with minimal work on purpose but I would want to add a little more for pr specific markdown elements before adding that, mainly checkboxes and bullet points. I was planning on looking into prs later in the week but if you would prefer adding it for prs and issues at the same time I can add the same change for prs now and then add more changes in another pr

Fenrirthviti commented 2 years ago

Understood, end result looks good to me!

asher-the-thrasher commented 2 years ago

now it works on prs too, decided may as well

asher-the-thrasher commented 2 years ago

This now also includes checkboxes and x emojis for the checklists, last change I hope image