Repository navigation
feat: one Discord forum post per mod, each release posted in its mod's post - #100
Conversation
…s post A mod's first release opens a post named after it in the forum behind DISCORD_MOD_FORUM_WEBHOOK, and its later releases go in that post. The post's ID is kept in a hidden comment at the end of the release's notes. A mod whose newest release isn't in its post yet is posted on the next run, so the mods released before the secret was set get their posts on the first push after.
A mod in a folder with no tag of its own is tagged Other, with a warning.
937b2f7 to
9c9d8e4
Compare
vdmkenny
left a comment
There was a problem hiding this comment.
An LLM wrote this review. I directed it, read it and approved it.
Thanks, this works well: I ran it against the published releases with Discord stubbed out, and every mod gets one post with the right tag.
One thing to fix: in to_forum the content is cut to 1900 characters and the links are added after that. The links line is up to 185 characters for the current mods, so a long change list goes over Discord's limit of 2000 and gets a 400 on every run. Cutting to 2000 - len(links) - 1 fixes it, in both places.
Also, json.load(response) in send can raise on a dropped connection. That fails the release job and skips the site rebuild. Catching OSError and ValueError there and returning 0, {} keeps the site safe.
I'll check the tag IDs and add the secret on my side.
vdmkenny
left a comment
There was a problem hiding this comment.
Both points are fixed and I checked them with Discord stubbed out. Thanks!
Each mod gets its own post in the Discord forum channel
#mod-discussions, so its releases and the talk about it stay in one place.How it works
mods/(Ships, Gameplay, Sound…), or Other, with a warning, for a folder that has no tag yet. The tags' IDs are inTAGSinrelease.py.<!-- discord-thread: ID -->at the end of the release's notes. GitHub doesn't show it, and the site only reads the-lines under## Changes. It's looked for in all of the mod's releases, so editing one release's notes by hand doesn't lose the post.DISCORD_MOD_RELEASES_WEBHOOKand#mod-releases.DISCORD_MOD_FORUM_WEBHOOK, the forum part is skipped.Needs
An admin must add the forum channel's webhook URL as the repository secret
DISCORD_MOD_FORUM_WEBHOOK. I'll send it in a DM.Tested
On a private test repository and a test forum channel, through GitHub Actions and then with this branch's code:
Not tested: posting in a post Discord archived for inactivity, and the tags, since their IDs only exist in
#mod-discussions(each current mod was checked to map to its folder's tag).