@mulmobridge/discord 1.0.1 → 1.0.2

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.js +3 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -34,9 +34,8 @@ mulmo.onPush((pushEvent) => {
34
34
  async function onPushEvent(pushEvent) {
35
35
  try {
36
36
  const channel = discord.channels.cache.get(pushEvent.chatId) ?? (await discord.channels.fetch(pushEvent.chatId).catch(() => null));
37
- if (channel?.isTextBased() && "send" in channel) {
38
- const sendable = channel;
39
- await sendChunkedToSendable(sendable, pushEvent.message);
37
+ if (channel?.isTextBased() && channel.isSendable()) {
38
+ await sendChunkedToSendable(channel, pushEvent.message);
40
39
  }
41
40
  else {
42
41
  console.warn(`[discord] push: channel ${pushEvent.chatId} not found or not text-based`);
@@ -83,7 +82,7 @@ async function sendChunked(msg, text) {
83
82
  if (i === 0) {
84
83
  await msg.reply(chunk);
85
84
  }
86
- else if ("send" in msg.channel) {
85
+ else if (msg.channel.isSendable()) {
87
86
  await msg.channel.send(chunk);
88
87
  }
89
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulmobridge/discord",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Discord bridge for MulmoBridge — connect a Discord bot to MulmoClaude",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "dotenv": "^17.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@types/node": "^26.1.1",
32
+ "@types/node": "^26.1.2",
33
33
  "typescript": "^6.0.3"
34
34
  },
35
35
  "homepage": "https://github.com/receptron/mulmoclaude/tree/main/packages/bridges/discord#readme",