Discourse チャット Webhook ドキュメント

Use the api to post to chat channel? からの議論の続きです。

webhook_url = 'https://forum.unofficed.com/chat/hooks/fff.json'
payload = {
    'text': 'Hello, world!',
    'username' : 'dexter',
    'avatar_url': 'https://forum.unofficed.com/user_avatar/forum.unofficed.com/dexter/120/801_2.png'
}
response = requests.post(webhook_url, data=payload)

「text」というキーを与えたように、他にどのようなパラメータを指定できますか? Discord を参考に username と avatar_url を追加しましたが、詳細なドキュメントはありますか?

「いいね!」 2

おかえりなさい!:wave:

Webhookを使用している場合、利用可能なパラメータはtextのみです。
Webhookを作成する際にユーザー名/アバターを定義します(管理者 → プラグイン → チャット)。

外部システムは、インバウンドWebフックを使用して、/hooks/:keyエンドポイント経由でボットユーザーとして指定されたチャットチャンネルにメッセージを投稿できます。ペイロードは単一のtextパラメータで構成され、2000文字に制限されています。

「いいね!」 3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.