@gonzih/cc-discord 0.1.13 → 0.1.14

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/bot.js +10 -1
  2. package/package.json +1 -1
package/dist/bot.js CHANGED
@@ -362,6 +362,7 @@ export class CcDiscordBot {
362
362
  if (mappedNs && this.redis) {
363
363
  this.writeChatMessage("user", "discord", text, effectiveChannelId, mappedNs.namespace);
364
364
  this.opts.registerRoutedChannelId?.(mappedNs.namespace, effectiveChannelId);
365
+ this.persistChannelMapping(effectiveChannelId, mappedNs.namespace, mappedNs.repoUrl);
365
366
  const username = msg.member?.displayName ?? msg.author.username;
366
367
  try {
367
368
  await routeToMetaAgent(mappedNs.namespace, stampPrompt(text, username, msg.createdAt), this.redis);
@@ -371,7 +372,12 @@ export class CcDiscordBot {
371
372
  }
372
373
  return;
373
374
  }
374
- // Local Claude session
375
+ // Unknown guild channel — reject rather than silently start a local session with wrong context
376
+ if (msg.guild) {
377
+ await msg.channel.send("This channel is not configured. Use `channel for https://github.com/org/repo` to set it up.").catch(() => { });
378
+ return;
379
+ }
380
+ // Local Claude session (DMs only beyond this point)
375
381
  const session = this.getOrCreateSession(effectiveChannelId, msg.channel);
376
382
  const username = msg.member?.displayName ?? msg.author.username;
377
383
  try {
@@ -404,6 +410,7 @@ export class CcDiscordBot {
404
410
  if (mappedNs && this.redis) {
405
411
  this.writeChatMessage("user", "discord", fullText, channelId, mappedNs.namespace);
406
412
  this.opts.registerRoutedChannelId?.(mappedNs.namespace, channelId);
413
+ this.persistChannelMapping(channelId, mappedNs.namespace, mappedNs.repoUrl);
407
414
  try {
408
415
  await routeToMetaAgent(mappedNs.namespace, prompt, this.redis);
409
416
  }
@@ -452,6 +459,7 @@ export class CcDiscordBot {
452
459
  const prompt = stampPrompt(fullText, imgUsername, msg.createdAt);
453
460
  this.writeChatMessage("user", "discord", fullText, channelId, mappedNs.namespace);
454
461
  this.opts.registerRoutedChannelId?.(mappedNs.namespace, channelId);
462
+ this.persistChannelMapping(channelId, mappedNs.namespace, mappedNs.repoUrl);
455
463
  try {
456
464
  await routeToMetaAgent(mappedNs.namespace, prompt, this.redis);
457
465
  }
@@ -493,6 +501,7 @@ export class CcDiscordBot {
493
501
  if (mappedNs && this.redis) {
494
502
  this.writeChatMessage("user", "discord", fullText, channelId, mappedNs.namespace);
495
503
  this.opts.registerRoutedChannelId?.(mappedNs.namespace, channelId);
504
+ this.persistChannelMapping(channelId, mappedNs.namespace, mappedNs.repoUrl);
496
505
  try {
497
506
  await routeToMetaAgent(mappedNs.namespace, prompt, this.redis);
498
507
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-discord",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Claude Code Discord bot — chat with Claude Code via Discord",
5
5
  "type": "module",
6
6
  "bin": {