디스코드로 관리자 알림 보내기

안녕하세요!

Discourse 인스턴스를 설정하는 중인데, Discord 서버로 직접 웹훅을 구성하려고 합니다. 하지만 Discord에 아무것도 푸시되지 않아서 막혀 있습니다. 다른 소프트웨어에서 웹훅을 사용해 본 경험이 있어서 비교적 간단할 것이라 생각했는데, Discourse에서는 그렇지 않은 것 같습니다.

핑 테스트는 항상 400 bad requests를 반환합니다. 관련 정보는 다음과 같습니다:

Headers:

ate: Wed, 01 Nov 2023 11:57:42 GMT
content-type: application/json
content-length: 58
connection: close
set-cookie: __dcfduid=dcf0233a78ad11eebb88d697d01a97e7; Expires=Mon, 30-Oct-2028 11:57:42 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/, __sdcfduid=dcf0233a78ad11eebb88d697d01a97e78400f2bac802b92ae5cd11d0fb83f18916f0fdca5d48d309bd75aaaaba4d1431; Expires=Mon, 30-Oct-2028 11:57:42 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/, __cf_bm=ACfLMGcKwXZiIw0euAAqKlZ1iroL0N.lG_2clanSP5M-1698839862-0-AUp8RGopNouFfnPVX/qbsLKr+5d1F9HQJ7zS9cGBeg6YH0urIlNg62SSP2cSSZFeZB9mC4TFRf323pdEHk5bTyY=; path=/; expires=Wed, 01-Nov-23 12:27:42 GMT; domain=.discordapp.com; HttpOnly; Secure; SameSite=None, __cfruid=7777c6c50b4e0b129fbc66ba8f4f6ab654a756c5-1698839862; path=/; domain=.discordapp.com; HttpOnly; Secure; SameSite=None, _cfuvid=mgEBXzSq5xWc_05ETnRJURj3e3yjIaRGrJQ0DeJyYA0-1698839862706-0-604800000; path=/; domain=.discordapp.com; HttpOnly; Secure; SameSite=None
strict-transport-security: max-age=31536000; includeSubDomains
x-ratelimit-bucket: 3d2712a9e4fe17cc9d3fed4a8e672e5f
x-ratelimit-limit: 5
x-ratelimit-remaining: 3
x-ratelimit-reset: 1698839864
x-ratelimit-reset-after: 1
via: 1.1 google
alt-svc: h3=":443"; ma=86400
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=WbIOWcprUjt2ga6UbHxwUh34HscqFqtWix5A9U%2FBKHOhRSCnydePJMngumK%2BgyupooTEjMuLVC%2FLhieBLLbD%2BQhTDdfNb4v%2BH2kO7ah8BdYbNNAU27fFaeErzlQYifFG"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 81f3f634dcf470fa-HEL

그리고 반환된 콘텐츠는 다음과 같습니다:

{"message": "Cannot send an empty message", "code": 50006}

어떤 부분을 확인해야 할지 아시는 분 계신가요? 작동하려면 채팅 플러그인이 필요한가요 (시해 보았지만 실패했습니다)? 뭔가 자명한 것을 놓치고 있는 것 같습니다. 또한, 웹훅에서 모든 항목을 활성화하고, 비어 있지 않은 페이로드를 사용해도 여전히 동일한 반환 콘텐츠를 받습니다.

{
  "category": {
    "id": 2,
    "name": "Feedback",
    "color": "0E76BD",
    "text_color": "FFFFFF",
    "slug": "feedback",
    "topic_count": 1,
    "post_count": 0,
    "position": 1,
    "description": "Feedback over ons forum <strong>forum.dtvwp.nl</strong>, onze website <strong>dtvwp.nl</strong> of over <strong>onze Facebook groepen</strong> mag hier geplaatst worden. We houden van constructieve feedback, dus feedback en suggesties zijn altijd welkom en erg gewaardeerd!",
    "description_text": "Feedback over ons forum forum.dtvwp.nl, onze website dtvwp.nl of over onze Facebook groepen mag hier geplaatst worden. We houden van constructieve feedback, dus feedback en suggesties zijn altijd welkom en erg gewaardeerd!",
    "description_excerpt": "Feedback over ons forum forum.dtvwp.nl, onze website dtvwp.nl of over onze Facebook groepen mag hier geplaatst worden. We houden van constructieve feedback, dus feedback en suggesties zijn altijd welkom en erg gewaardeerd!",
    "topic_url": "/t/over-het-forum-feedback/1",
    "read_restricted": false,
    "permission": null,
    "topic_template": null,
    "has_children": null,
    "sort_order": null,
    "sort_ascending": null,
    "show_subcategory_list": false,
    "num_featured_topics": 3,
    "default_view": null,
    "subcategory_list_style": "rows_with_featured_topics",
    "default_top_period": "all",
    "default_list_filter": "all",
    "minimum_required_tags": 0,
    "navigate_to_first_post_after_read": false,
    "custom_fields": {},
    "allowed_tags": [],
    "allowed_tag_groups": [],
    "allow_global_tags": false,
    "read_only_banner": null,
    "form_template_ids": [],
    "auto_close_hours": null,
    "auto_close_based_on_last_post": false,
    "group_permissions": [
      {
        "permission_type": 1,
        "group_name": "iedereen"
      }
    ],
    "email_in": null,
    "email_in_allow_strangers": false,
    "mailinglist_mirror": false,
    "all_topics_wiki": false,
    "allow_unlimited_owner_edits_on_first_post": false,
    "cannot_delete_reason": "Deze categorie kan niet worden verwijderd, omdat het aantal topics 1 is.",
    "is_special": true,
    "allow_badges": true,
    "topic_featured_link_allowed": true,
    "search_priority": 0,
    "default_slow_mode_seconds": null,
    "uploaded_logo": null,
    "uploaded_logo_dark": null,
    "uploaded_background": null,
    "required_tag_groups": [],
    "category_setting": {
      "auto_bump_cooldown_days": 1,
      "num_auto_bump_daily": 0,
      "require_reply_approval": false,
      "require_topic_approval": false
    }
  }
}

지금은 우리가 보고 싶은 유일한 훅/알림은 새로운 사용자가 이메일을 확인하고 관리자/운영자의 승인을 기다리는 상태가 되었을 때입니다 - 이 경우 우리의 Discord 채널로 핑을 받으면 됩니다.

이 문제는 이전에 제기된 적이 있습니다. 문제는 Discourse 웹훅에서 게시되는 데이터가 디스코드가 기대하는 형식이 아니기 때문이라고 생각합니다. 이 주제에 대한 첫 두 개의 답변에 해당 문제에 대한 세부 사항이 나와 있습니다: Has any one tried webhooks with Discord?.

웹훅을 Zapier로 지정한 다음, Zapier를 사용하여 웹훅을 디스코드가 기대하는 형식으로 변환할 수 있습니다. 하지만 이 경우 최소 $20/월의 비용이 듭니다.

현재 사례에는 도움이 되지 않을 것 같지만, Discourse에서 디스코드로 게시하는 좋은 방법은 여기에서 설명되어 있습니다: Set up Discord notifications with the discourse-chat-integration plugin.