# 사용자 게시물에 직원 공지사항을 자동으로 추가

**URL:** <https://meta.discourse.org/t/automatically-append-staff-notice-to-user-posts/254123>\
**Category:** Development\
**Tags:** post-notices\
**Created:** [2월 5, 2023, 4: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:** 8

<div class="post-metadata">

**Author:** ![Decorbuz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/decorbuz/32/235124_2.png) [@Decorbuz](https://meta.discourse.org/u/Decorbuz)\
**Post date:** [2월 19, 2023, 6:14오후 UTC](https://meta.discourse.org/t/automatically-append-staff-notice-to-user-posts/254123/8 "2023-02-19T18:14:50Z")

</div>

> [@JammyDodger](#):
>
> 자동 도구에 너무 의존해서 직접 확인을 하지 않았습니다. 🙂 다른 토픽은 삭제했습니다. 👍

감사합니다! 😊

> [@jhealey](#):
>
> 안녕하세요!
> 
> “autogenerated” 그룹의 멤버인 자동 생성된 계정에 직원 공지사항을 자동으로 추가하려고 JS를 사용했는데, 어디서 잘못되고 있는지 모르겠습니다.
> 
> ```plaintext
> <script>
> window.onload = function() {
> const { groupMembers } = await discourse.groups.getMembers({
> group_name: 'autogenerated'
> });
> 
> if (groupMembers.includes(helper.getModel().user_id)) {
> return helper.h('div.post-notices', [
> helper.rawHtml(iconHTML('shield-alt')),
> helper.h('p', 'This account is auto-generated and should be considered as a bot. The account is not monitored by Staff.')
> ]);
> }
> }
> </script>
> 
> ```
> 
> 코드를 컴포넌트의 “Head” 부분에 넣었지만 실행되지 않습니다. 함수를 올바르게 호출하지 못하고 있는지, 아니면 IF 문건의 조건이 갑자기 충족되지 않는지 알 수 없습니다.

`await`를 사용하려면 해당 함수는 `async`여야 합니다.

---

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