# تذكير من Discoursebot بتنسيق الأكواد وسجلات السجلات والملفات الإعدادية وما إلى ذلك

**URL:** https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440
**Category:** Feature
**Created:** [4 يونيو 2019، 2:39ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440 "2019-06-04T02:39:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_Walkom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_walkom/32/77411_2.png) [@Mark\_Walkom](https://meta.discourse.org/u/Mark_Walkom)
#### Post date: [4 يونيو 2019، 2:40ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/1 "2019-06-04T02:40:00Z")

</div>

[Home Assistant](https://community.home-assistant.io/) 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 🙂

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [4 يونيو 2019، 7:11ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/2 "2019-06-04T07:11:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Mark\_Walkom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_walkom/32/77411_2.png) [@Mark\_Walkom](https://meta.discourse.org/u/Mark_Walkom)
#### Post date: [4 يونيو 2019، 7:22ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/3 "2019-06-04T07:22:52Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [4 يونيو 2019، 7:42ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/4 "2019-06-04T07:42:47Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [4 يونيو 2019، 8:06ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/5 "2019-06-04T08:06:19Z")

</div>

I think @lionel-rowe built [Unformatted Code Detector](https://meta.discourse.org/t/unformatted-code-detector-theme-component/112773) 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.

---

<div class="post-metadata">

### Author: ![Mark\_Walkom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_walkom/32/77411_2.png) [@Mark\_Walkom](https://meta.discourse.org/u/Mark_Walkom)
#### Post date: [4 يونيو 2019، 8:15ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/6 "2019-06-04T08:15:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [4 يونيو 2019، 8:57ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/7 "2019-06-04T08:57:31Z")

</div>

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. 🤷‍♂️

---

<div class="post-metadata">

### Author: ![Mark\_Walkom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_walkom/32/77411_2.png) [@Mark\_Walkom](https://meta.discourse.org/u/Mark_Walkom)
#### Post date: [4 يونيو 2019، 9:03ص UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/8 "2019-06-04T09:03:25Z")

</div>

Ahh that is awesome, thanks for the referral.

---

<div class="post-metadata">

### Author: ![lionel-rowe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lionel-rowe/32/134288_2.png) [@lionel-rowe](https://meta.discourse.org/u/lionel-rowe)
#### Post date: [5 يونيو 2019، 5:36م UTC](https://meta.discourse.org/t/discoursebot-reminder-to-format-code-logs-configs-etc/119440/9 "2019-06-05T17:36:40Z")

</div>

> [@sam](#):
>
> I think @lionel-rowe built [Unformatted Code Detector theme component](https://meta.discourse.org/t/unformatted-code-detector-theme-component/112773) for this.

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).
