From cfae833206e9ca2322c3e9f882da971d56e463f5 Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:03:34 -0400 Subject: [PATCH 1/8] fix inability to thread --- src/utilities/helperFunctions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilities/helperFunctions.js b/src/utilities/helperFunctions.js index 372a856..694e426 100644 --- a/src/utilities/helperFunctions.js +++ b/src/utilities/helperFunctions.js @@ -39,8 +39,8 @@ const isNotModerator = async (user) => { return true; }; -const processMessage = async ({ text, user, ts, channel }) => { - if (MONITORED_CHANNELS.includes(channel) && (await isNotModerator(user))) { +const processMessage = async ({ text=null, user=null,,, ts, channel, subtype=null }) => { + if (MONITORED_CHANNELS.includes(channel) && (await isNotModerator(user)) && !subtype && subtype != "message_replied") { if (isDev()) { console.log( `text: ${text}\nuser: ${user}\nts: ${ts}\nchannel: ${channel}\n` From 17f638de083efece78664134545ed550584c43b6 Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:05:23 -0400 Subject: [PATCH 2/8] typo --- src/utilities/helperFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/helperFunctions.js b/src/utilities/helperFunctions.js index 694e426..47d2090 100644 --- a/src/utilities/helperFunctions.js +++ b/src/utilities/helperFunctions.js @@ -39,7 +39,7 @@ const isNotModerator = async (user) => { return true; }; -const processMessage = async ({ text=null, user=null,,, ts, channel, subtype=null }) => { +const processMessage = async ({ text=null, user=null, ts, channel, subtype=null }) => { if (MONITORED_CHANNELS.includes(channel) && (await isNotModerator(user)) && !subtype && subtype != "message_replied") { if (isDev()) { console.log( From d763b4a6a82db66f69ba700d2fd180aebcc9e2c3 Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:08:30 -0400 Subject: [PATCH 3/8] wait it was way easier than i thought --- src/server.js | 2 +- src/utilities/helperFunctions.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.js b/src/server.js index 133f706..fc5c025 100644 --- a/src/server.js +++ b/src/server.js @@ -11,7 +11,7 @@ app.message(({ message, message: { subtype } }) => { if (isDev()) { console.log(message); } - if (subtype != "message_deleted") { + if (subtype != "message_deleted" || subtype != "message_replied") { processMessage(message); } }); diff --git a/src/utilities/helperFunctions.js b/src/utilities/helperFunctions.js index 47d2090..372a856 100644 --- a/src/utilities/helperFunctions.js +++ b/src/utilities/helperFunctions.js @@ -39,8 +39,8 @@ const isNotModerator = async (user) => { return true; }; -const processMessage = async ({ text=null, user=null, ts, channel, subtype=null }) => { - if (MONITORED_CHANNELS.includes(channel) && (await isNotModerator(user)) && !subtype && subtype != "message_replied") { +const processMessage = async ({ text, user, ts, channel }) => { + if (MONITORED_CHANNELS.includes(channel) && (await isNotModerator(user))) { if (isDev()) { console.log( `text: ${text}\nuser: ${user}\nts: ${ts}\nchannel: ${channel}\n` From 919ba5f7f3f7e3006fc7372194f1efa5f5639fa0 Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:10:22 -0400 Subject: [PATCH 4/8] wrong check --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index fc5c025..ecfc8be 100644 --- a/src/server.js +++ b/src/server.js @@ -11,7 +11,7 @@ app.message(({ message, message: { subtype } }) => { if (isDev()) { console.log(message); } - if (subtype != "message_deleted" || subtype != "message_replied") { + if (subtype != "message_deleted" && subtype != "message_replied") { processMessage(message); } }); From ac618a0de9fa3d725c23bf253ed7d628615b5cbb Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:13:03 -0400 Subject: [PATCH 5/8] testing --- src/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server.js b/src/server.js index ecfc8be..32ff1dd 100644 --- a/src/server.js +++ b/src/server.js @@ -8,6 +8,7 @@ const { isDev, processMessage } = require("./utilities/helperFunctions.js"); //globals app.message(({ message, message: { subtype } }) => { + console.log(message) if (isDev()) { console.log(message); } From 9633c337d1d18aaf1eff6778561baf226374dfde Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:16:32 -0400 Subject: [PATCH 6/8] work aroudn slack's bug --- src/server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server.js b/src/server.js index 32ff1dd..894d777 100644 --- a/src/server.js +++ b/src/server.js @@ -7,12 +7,11 @@ const { isDev, processMessage } = require("./utilities/helperFunctions.js"); //globals -app.message(({ message, message: { subtype } }) => { - console.log(message) +app.message(({ message, message: { thread_ts=null, subtype } }) => { if (isDev()) { console.log(message); } - if (subtype != "message_deleted" && subtype != "message_replied") { + if (subtype != "message_deleted" && !thread_ts) { processMessage(message); } }); From 915b1da84d33894b454f7c8298544f0ac441404b Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:20:25 -0400 Subject: [PATCH 7/8] 1.0.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 09f72b3..df7c0ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "watchdog", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "watchdog", - "version": "1.0.2", + "version": "1.0.3", "license": "MIT", "dependencies": { "@slack/bolt": "^3.6.0", diff --git a/package.json b/package.json index ee33303..301e456 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "watchdog", - "version": "1.0.2", + "version": "1.0.3", "description": "A Slack integration to keep announcement channels free of clutter", "main": "src/server.js", "scripts": { From 2668f4e0337609bf7035c996c0c7605ea047b58c Mon Sep 17 00:00:00 2001 From: Dan Bruce Date: Mon, 29 Sep 2025 18:23:04 -0400 Subject: [PATCH 8/8] remove old CI stuff --- .github/workflows/codeql-analysis.yml | 67 --------------------------- .github/workflows/node.js.yml | 30 ------------ 2 files changed, 97 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 49b664c..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '23 5 * * 0' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index f532bee..0000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12.x, 14.x, 16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install - - run: npm run lint