@theholocron/holocron-plugin-discord 5.0.0-alpha.185 → 5.0.0-alpha.186

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 +7 -4
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -171,10 +171,13 @@ var DiscordNotifications = class DiscordNotifications {
171
171
  async ensureRole(input) {
172
172
  const bot = this.bot();
173
173
  const existing = (await bot.guilds.roles(this.guild())).find((r) => DiscordNotifications.same(r.name, input.name));
174
- if (existing) return {
175
- id: existing.id,
176
- created: false
177
- };
174
+ if (existing) {
175
+ if (input.mentionable !== void 0 && existing.mentionable !== input.mentionable) throw new Error(`role \`${input.name}\` exists with mentionable=${existing.mentionable} but the layout wants ${input.mentionable}; updating an existing role is not supported yet — change it in Discord (Role → Allow anyone to @mention this role)`);
176
+ return {
177
+ id: existing.id,
178
+ created: false
179
+ };
180
+ }
178
181
  return {
179
182
  id: (await bot.guilds.createRole(this.guild(), {
180
183
  name: input.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-discord",
3
- "version": "5.0.0-alpha.185",
3
+ "version": "5.0.0-alpha.186",
4
4
  "description": "Holocron plugin for Discord. Implements the notifications capability via Discord incoming webhooks.",
5
5
  "keywords": [
6
6
  "discord",
@@ -48,12 +48,12 @@
48
48
  "tsx": "4.23.15",
49
49
  "typescript": "^5.9.3",
50
50
  "vitest": "^4.1.11",
51
- "@theholocron/cli": "5.0.0-alpha.185"
51
+ "@theholocron/cli": "5.0.0-alpha.186"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@theholocron/discord-client": "^1.43.1",
55
55
  "@theholocron/misc-utils": "^1.16.0",
56
- "@theholocron/cli": "5.0.0-alpha.185"
56
+ "@theholocron/cli": "5.0.0-alpha.186"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"