@theholocron/holocron-plugin-discord 5.0.0-alpha.275 → 5.0.0-alpha.276

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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -1
  2. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -292,17 +292,19 @@ var DiscordNotifications = class DiscordNotifications {
292
292
  const bot = this.bot();
293
293
  const channels = await this.channelList();
294
294
  const categoryName = new Map(channels.filter((c) => c.type === ChannelType.Category).map((c) => [c.id, c.name]));
295
- const wantsWebhook = new Set((layout.categories ?? []).flatMap((c) => (c.channels ?? []).filter((ch) => ch.webhook).map((ch) => ch.name.toLowerCase())));
295
+ const wantsWebhook = new Set((layout.categories ?? []).flatMap((c) => (c.channels ?? []).filter((ch) => ch.webhook || ch.feeds?.monitoring || ch.feeds?.errors).map((ch) => ch.name.toLowerCase())));
296
296
  const text = channels.filter((c) => c.type === ChannelType.Text || c.type === ChannelType.Announcement);
297
297
  const found = [];
298
298
  for (const c of text) {
299
299
  let webhooks = [];
300
300
  let webhookAvatars = [];
301
+ let webhookIds = {};
301
302
  let webhooksError;
302
303
  if (wantsWebhook.has(c.name.toLowerCase())) try {
303
304
  const hooks = await bot.channels.webhooks(c.id);
304
305
  webhooks = hooks.map((w) => w.name ?? "");
305
306
  webhookAvatars = hooks.filter((w) => w.avatar).map((w) => w.name ?? "");
307
+ webhookIds = Object.fromEntries(hooks.map((w) => [(w.name ?? "").toLowerCase(), w.id]));
306
308
  } catch (err) {
307
309
  webhooksError = reason(err);
308
310
  }
@@ -313,6 +315,7 @@ var DiscordNotifications = class DiscordNotifications {
313
315
  ...c.topic ? { topic: c.topic } : {},
314
316
  webhooks,
315
317
  webhookAvatars,
318
+ webhookIds,
316
319
  ...webhooksError ? { webhooksError } : {}
317
320
  });
318
321
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-discord",
3
- "version": "5.0.0-alpha.275",
3
+ "version": "5.0.0-alpha.276",
4
4
  "description": "Holocron plugin for Discord. Implements the notifications capability via Discord incoming webhooks.",
5
5
  "keywords": [
6
6
  "discord",
@@ -41,19 +41,19 @@
41
41
  "tsx": "4.23.15",
42
42
  "typescript": "^5.9.3",
43
43
  "vitest": "^5.0.5",
44
- "@theholocron/cli": "5.0.0-alpha.275",
45
44
  "@theholocron/discord-client": "^1.58.0-alpha.3",
46
45
  "@theholocron/eslint-config": "^8.9.0-alpha.3",
47
- "@theholocron/misc-utils": "^1.16.1-alpha.1",
48
46
  "@theholocron/http-client": "^1.58.0-alpha.3",
49
- "@theholocron/tsconfig": "^8.9.0-alpha.3",
47
+ "@theholocron/misc-utils": "^1.16.1-alpha.1",
48
+ "@theholocron/vitest-config": "^8.9.0-alpha.3",
50
49
  "@theholocron/tsdown-config": "^8.9.0-alpha.3",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.3"
50
+ "@theholocron/tsconfig": "^8.9.0-alpha.3",
51
+ "@theholocron/cli": "5.0.0-alpha.276"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@theholocron/discord-client": "^1.50.0",
55
55
  "@theholocron/misc-utils": "^1.16.0",
56
- "@theholocron/cli": "5.0.0-alpha.275"
56
+ "@theholocron/cli": "5.0.0-alpha.276"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"