niahere 0.3.8 → 0.3.9
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/package.json +1 -1
- package/src/channels/slack.ts +4 -2
package/package.json
CHANGED
package/src/channels/slack.ts
CHANGED
|
@@ -136,6 +136,7 @@ class SlackChannel implements Channel {
|
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
let botUserId: string | undefined;
|
|
139
|
+
let botId: string | undefined;
|
|
139
140
|
|
|
140
141
|
const watchReloader = new SlackWatchReloader();
|
|
141
142
|
const attachmentCache = new SlackAttachmentCache(botToken);
|
|
@@ -237,7 +238,7 @@ class SlackChannel implements Channel {
|
|
|
237
238
|
inclusive: true,
|
|
238
239
|
});
|
|
239
240
|
const parentMsg = parent.messages?.[0];
|
|
240
|
-
if (parentMsg && (parentMsg.user === botUserId || parentMsg.bot_id)) {
|
|
241
|
+
if (parentMsg && (parentMsg.user === botUserId || (botId && parentMsg.bot_id === botId))) {
|
|
241
242
|
isActiveThread = true;
|
|
242
243
|
log.debug(
|
|
243
244
|
{ channel: msg.channel, thread_ts: msg.thread_ts },
|
|
@@ -493,7 +494,8 @@ class SlackChannel implements Channel {
|
|
|
493
494
|
try {
|
|
494
495
|
const auth = await app.client.auth.test();
|
|
495
496
|
botUserId = auth.user_id as string | undefined;
|
|
496
|
-
|
|
497
|
+
botId = auth.bot_id as string | undefined;
|
|
498
|
+
log.info({ botUserId, botId }, "slack bot authenticated");
|
|
497
499
|
} catch (err) {
|
|
498
500
|
log.warn({ err }, "could not get slack bot user ID");
|
|
499
501
|
}
|