nodebb-plugin-discord-onekite 1.1.15 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/library.js +2 -11
- package/package.json +1 -1
- package/templates/admin/plugins/discord-onekite.tpl +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# nodebb-plugin-discord-onekite v1.1.4.
|
|
1
|
+
# nodebb-plugin-discord-onekite v1.1.4.9
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
3
|
+
ACP uses official NodeBB approach (quickstart):
|
|
4
|
+
- `settings.sync()` + `settings.persist()`
|
|
5
|
+
- save button partial (bottom-right)
|
|
6
|
+
|
|
7
|
+
Discord embed:
|
|
8
|
+
- clickable title (embed.url)
|
|
9
|
+
- description = message excerpt only
|
package/library.js
CHANGED
|
@@ -129,7 +129,8 @@ async function getPostExcerpt(pid) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
async function buildPayload({ tid, pid, isReply }) {
|
|
132
|
-
|
|
132
|
+
let baseUrl = normalizeBaseUrl(meta.config.url || meta.config['url']);
|
|
133
|
+
if (!baseUrl) { baseUrl = 'https://www.onekite.com'; }
|
|
133
134
|
|
|
134
135
|
const topicData = await topics.getTopicFields(tid, ['tid', 'uid', 'cid', 'title', 'slug', 'mainPid']);
|
|
135
136
|
if (!topicData) return null;
|
|
@@ -183,16 +184,6 @@ Plugin.init = async ({ router }) => {
|
|
|
183
184
|
);
|
|
184
185
|
|
|
185
186
|
// AJAX save endpoint for ACP (used by admin.js)
|
|
186
|
-
router.post('/api/admin/plugins/discord-onekite/save',
|
|
187
|
-
middleware.admin.checkPrivileges,
|
|
188
|
-
async (req, res) => {
|
|
189
|
-
try {
|
|
190
|
-
const payload = {
|
|
191
|
-
webhookUrl: req.body.webhookUrl || '',
|
|
192
|
-
notifyReplies: req.body.notifyReplies ? 'on' : '',
|
|
193
|
-
cids: req.body.cids || '',
|
|
194
|
-
};
|
|
195
|
-
await meta.settings.set(SETTINGS_KEY, payload);
|
|
196
187
|
res.json({ ok: true });
|
|
197
188
|
} catch (e) {
|
|
198
189
|
console.error('[discord-onekite] save failed', e);
|
package/package.json
CHANGED