# Añadir automáticamente aviso del personal a las publicaciones del usuario

**URL:** <https://meta.discourse.org/t/automatically-append-staff-notice-to-user-posts/254123>\
**Category:** Development\
**Tags:** post-notices\
**Created:** [5 Febrero, 2023 16:33 UTC](https://meta.discourse.org/t/automatically-append-staff-notice-to-user-posts/254123 "2023-02-05T16:33:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)\
**Post date:** [6 Febrero, 2023 09:01 UTC](https://meta.discourse.org/t/automatically-append-staff-notice-to-user-posts/254123/2 "2023-02-06T09:01:35Z")

</div>

Creo que puedes lograr esto con componentes de tema. Por ejemplo, este código hace lo que necesitas:

```javascript
<script type="text/discourse-plugin" version="0.8">

const { iconHTML } = require("discourse-common/lib/icon-library");

const bot_id = 128856; // o algún otro
api.decorateWidget("post:before", (helper) => {
    if (helper?.getModel()?.user_id !== bot_id) {return;}
    return helper.h("div.post-notice",[
        helper.rawHtml(iconHTML("shield-alt")), // nombre del icono
        helper.h("p", "este es un bot"), // texto
    ]);
});

</script>

```

---

_[View the full topic](https://meta.discourse.org/t/automatically-append-staff-notice-to-user-posts/254123)._
