From 1b4e7d66ece31abb76ecd59ca0e2e171b8c50d97 Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Thu, 9 Feb 2023 02:42:32 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A2=91=E9=81=93=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channels/debug/_group.yml | 1 + channels/debug/echo.yml | 9 +++++++++ channels/isekaibbs/_group.yml | 1 + channels/isekaibbs/newPost.yml | 11 +++++++++++ channels/isekaibbs/newReply.yml | 11 +++++++++++ channels/isekaiwiki/_group.yml | 2 +- channels/isekaiwiki/admin/_group.yml | 2 +- channels/isekaiwiki/admin/autoReview.yml | 22 +++++++++++----------- channels/isekaiwiki/admin/needReview.yml | 23 ++++++++++++----------- channels/isekaiwiki/editPage.yml | 22 +++++++++++----------- channels/isekaiwiki/newPage.yml | 23 ++++++++++++----------- channels/mwclub/_group.yml | 1 + channels/mwclub/newPost.yml | 12 ++++++++++++ channels/mwclub/newReply.yml | 11 +++++++++++ push-test/index.js | 7 ++----- 15 files changed, 107 insertions(+), 51 deletions(-) create mode 100644 channels/debug/_group.yml create mode 100644 channels/debug/echo.yml create mode 100644 channels/isekaibbs/_group.yml create mode 100644 channels/isekaibbs/newPost.yml create mode 100644 channels/isekaibbs/newReply.yml create mode 100644 channels/mwclub/_group.yml create mode 100644 channels/mwclub/newPost.yml create mode 100644 channels/mwclub/newReply.yml diff --git a/channels/debug/_group.yml b/channels/debug/_group.yml new file mode 100644 index 0000000..3b05021 --- /dev/null +++ b/channels/debug/_group.yml @@ -0,0 +1 @@ +name: "测试" diff --git a/channels/debug/echo.yml b/channels/debug/echo.yml new file mode 100644 index 0000000..003eded --- /dev/null +++ b/channels/debug/echo.yml @@ -0,0 +1,9 @@ +name: 发送调试信息 +provider: pusher +source: + service: pusher + channel: debug + type: echo +tpl: + default: |- + {{msg}} diff --git a/channels/isekaibbs/_group.yml b/channels/isekaibbs/_group.yml new file mode 100644 index 0000000..fe752d8 --- /dev/null +++ b/channels/isekaibbs/_group.yml @@ -0,0 +1 @@ +name: "异世界红茶馆" diff --git a/channels/isekaibbs/newPost.yml b/channels/isekaibbs/newPost.yml new file mode 100644 index 0000000..41f33c0 --- /dev/null +++ b/channels/isekaibbs/newPost.yml @@ -0,0 +1,11 @@ +name: 新帖子 +provider: pusher +source: + service: pusher + channel: isekaibbs + type: newPost +tpl: + default: |- + {{{postUser.displayname}}}「{{{postUser.username}}}」发布了帖子《{{{topic.titleRaw}}}》: + {{{excerpt post.content 100}}} + {{{topic.url}}} diff --git a/channels/isekaibbs/newReply.yml b/channels/isekaibbs/newReply.yml new file mode 100644 index 0000000..6ae005c --- /dev/null +++ b/channels/isekaibbs/newReply.yml @@ -0,0 +1,11 @@ +name: 新回复 +provider: pusher +source: + service: pusher + channel: isekaibbs + type: newReply +tpl: + default: |- + {{{postUser.displayname}}}「{{{postUser.username}}}」回复了 {{{topicUser.displayname}}}「{{{topicUser.username}}}」的帖子《{{topic.titleRaw}}》: + {{{excerpt post.content 100}}} + {{{post.url}}} diff --git a/channels/isekaiwiki/_group.yml b/channels/isekaiwiki/_group.yml index d370f19..456618a 100644 --- a/channels/isekaiwiki/_group.yml +++ b/channels/isekaiwiki/_group.yml @@ -1 +1 @@ -name: "异世界百科" +name: "异世界百科" diff --git a/channels/isekaiwiki/admin/_group.yml b/channels/isekaiwiki/admin/_group.yml index 3766773..c0827b6 100644 --- a/channels/isekaiwiki/admin/_group.yml +++ b/channels/isekaiwiki/admin/_group.yml @@ -1 +1 @@ -name: "管理信息" +name: "管理信息" diff --git a/channels/isekaiwiki/admin/autoReview.yml b/channels/isekaiwiki/admin/autoReview.yml index 25ebaa9..131c818 100644 --- a/channels/isekaiwiki/admin/autoReview.yml +++ b/channels/isekaiwiki/admin/autoReview.yml @@ -1,11 +1,11 @@ -name: 自动审核通过 -provider: pusher -source: - service: pusher - channel: isekaiwiki - type: autoReview -tpl: - default: |- - {{{author}}} 更新了新页面: {{{title}}} - {{{summary}}} - {{{result}}} +name: 自动审核通过 +provider: pusher +source: + service: pusher + channel: isekaiwiki + type: autoReview +tpl: + default: |- + {{{author}}} 更新了页面: {{{title}}} + {{{summary}}} + {{{result}}} diff --git a/channels/isekaiwiki/admin/needReview.yml b/channels/isekaiwiki/admin/needReview.yml index 196ce64..22f3867 100644 --- a/channels/isekaiwiki/admin/needReview.yml +++ b/channels/isekaiwiki/admin/needReview.yml @@ -1,11 +1,12 @@ -name: 待审页面 -provider: pusher -source: - service: pusher - channel: isekaiwiki - type: needReview -tpl: - default: |- - Review队列更新: - {{{author}}} 更新了页面: {{{title}}} - {{{summary}}} +name: 待审页面 +provider: pusher +source: + service: pusher + channel: isekaiwiki + type: needReview +tpl: + default: |- + Review队列中增加了新页面: + 编辑者: {{{author}}} + 标题: {{{title}}} + {{{summary}}} diff --git a/channels/isekaiwiki/editPage.yml b/channels/isekaiwiki/editPage.yml index 5d1a120..7bbfd2c 100644 --- a/channels/isekaiwiki/editPage.yml +++ b/channels/isekaiwiki/editPage.yml @@ -1,11 +1,11 @@ -name: 修改页面 -provider: pusher -source: - service: pusher - channel: isekaiwiki - type: edit -tpl: - default: |- - {{{author}}} 更新了页面: {{{title}}} - {{{summary}}} - {{{url}}} +name: 修改页面 +provider: pusher +source: + service: pusher + channel: isekaiwiki + type: edit +tpl: + default: |- + {{{author}}} 更新了页面《{{{title}}}》: + {{{summary}}} + {{{url}}} diff --git a/channels/isekaiwiki/newPage.yml b/channels/isekaiwiki/newPage.yml index e6b4986..c6eab36 100644 --- a/channels/isekaiwiki/newPage.yml +++ b/channels/isekaiwiki/newPage.yml @@ -1,11 +1,12 @@ -name: 新页面 -provider: pusher -source: - service: pusher - channel: isekaiwiki - type: new -tpl: - default: |- - {{{author}}} 创建了新页面: {{{title}}} - {{{summary}}} - {{{url}}} +name: 新页面 +provider: pusher +source: + service: pusher + channel: isekaiwiki + type: new +tpl: + default: |- + {{{author}}} 创建了新页面《{{{title}}}》: + {{{summary}}} + + {{{url}}} diff --git a/channels/mwclub/_group.yml b/channels/mwclub/_group.yml new file mode 100644 index 0000000..fd05f4e --- /dev/null +++ b/channels/mwclub/_group.yml @@ -0,0 +1 @@ +name: "MediaWiki Club" diff --git a/channels/mwclub/newPost.yml b/channels/mwclub/newPost.yml new file mode 100644 index 0000000..d6bfe06 --- /dev/null +++ b/channels/mwclub/newPost.yml @@ -0,0 +1,12 @@ +name: 新帖子 +provider: pusher +source: + service: pusher + channel: mwclub + type: newPost +tpl: + default: |- + {{{postUser.displayname}}}「@{{{postUser.username}}}」发布了帖子《{{{topic.titleRaw}}}》: + + {{{excerpt post.content 100}}} + {{{topic.url}}} diff --git a/channels/mwclub/newReply.yml b/channels/mwclub/newReply.yml new file mode 100644 index 0000000..e911790 --- /dev/null +++ b/channels/mwclub/newReply.yml @@ -0,0 +1,11 @@ +name: 新回复 +provider: pusher +source: + service: pusher + channel: mwclub + type: newReply +tpl: + default: |- + {{postUser.displayname}}「@{{postUser.username}}」回复了 {{topicUser.displayname}}「@{{topicUser.username}}」的帖子《{{topic.titleRaw}}》: + {{Utils.excerpt(post.content, 100)}} + {{post.url}} diff --git a/push-test/index.js b/push-test/index.js index 789c86b..8ccdc2f 100644 --- a/push-test/index.js +++ b/push-test/index.js @@ -11,9 +11,6 @@ var pusher = new Pusher({ cluster: config.service.pusher.cluster }); -pusher.trigger('isekai', 'newPage', { - author: "Hyperzlib", - title: "沙盒", - summary: "机器人应该可以用了", - url: "https://www.isekai.cn/ShaHe" +pusher.trigger('debug', 'echo', { + msg: "推送系统应该已经好了" });