테마 컴포넌트를 사용하면 이 작업을 수행할 수 있다고 생각합니다. 예를 들어, 다음 코드가 필요한 작업을 수행합니다:
<script type="text/discourse-plugin" version="0.8">
const { iconHTML } = require("discourse-common/lib/icon-library");
const bot_id = 128856; // or some else
api.decorateWidget("post:before", (helper) => {
if (helper?.getModel()?.user_id !== bot_id) {return;}
return helper.h("div.post-notice",[
helper.rawHtml(iconHTML("shield-alt")), // icon name
helper.h("p", "this is a bot"), // text
]);
});
</script>