Discoursebot reminder to format code/logs/configs etc

AI-generated summary

A discussion is taking place about creating a bot to remind users to format their code/logs/configs properly in Discourse. Mark_Walkom suggests a bot that can post a friendly reminder once per topic, while codinghorror proposes blocking the post until the user formats their code correctly.

codinghorror mentions that there are existing discussions about such a plugin, and sam points to the “Unformatted Code Detector theme component” built by lionel-rowe as a possible solution. Mark_Walkom prefers the bot approach to avoid cluttering the topic with moderation tasks. codinghorror argues that it’s better to nudge users to format their posts before submission, citing experience from Stack Overflow. lionel-rowe invites feedback on the theme component, acknowledging it may not have perfect coverage.

Home Assistant have a banner, which is nice. But easily dismissible. A bot seems like a more engaging way to remind people, but there may need to be limits around it so it only posts once per topic (for eg).

I dunno if anyone has thought of this, but it’d be pretty rad if this existed, and I don’t have the skills to upgrade it to do this :slight_smile:

I am not following. How exactly do you imagine this working?

If someone posts an unformatted, code-like blob of text, the bot chimes in and reminds the poster to format it appropriately.

Wouldn’t it be more effective to block the post until such time as the user fixes it and formats their code? Why clutter the topic with back and forth when you can fix it at the source? There’s several discussions here about such a plugin.

3 Likes

I think @lionel-rowe built Unformatted Code Detector for this.

Your mileage will vary here cause it depends on regexes and may have false positives / negatives, but I am sure it could be a reasonable starting point if you have a pathological issue.

2 Likes

Effective for whom? I don’t want to have to moderate all of them, neither do I want that on the other mods.

Having a single auto-post from a bot with a friendly reminder seems a lot less jarring than blocking a user.

I don’t think it makes sense to clutter topics with a lot of generic auto-replies. It’s better to nudge the user to properly format their post before it can be submitted.

Trust me, I spent years dealing with this at Stack Overflow. :man_shrugging:

3 Likes

Ahh that is awesome, thanks for the referral.

Yes indeed! @Mark_Walkom If you or your users spot any false negatives/positives per your use case, bug reports are always welcome (though it won’t ever have perfect coverage).

5 Likes