From e198ca3b4d86515d7fd1a21de26396a49b7a6ef3 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 10:20:28 -0400 Subject: [PATCH 01/11] Versioning --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0bdec5..29769c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ ## v3.6.x +#### v3.6.1 (#32) Improving Requests +* Start logging message URLs and timestamps when requests are submitted. +* Plan to improve request submission process to interactive slash-command. + #### v3.6.0 (#31) Fixing GIF APIs * Switch from Tenor to Giphy for GIFs diff --git a/package.json b/package.json index 9650768..5825fb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodbot", - "version": "3.6.0", + "version": "3.6.1", "description": "Nods and Nod Accessories", "main": "main.js", "dependencies": { From fc941ad487e8b4ff5a501a1f61f9ba6011728978 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 12:03:47 -0400 Subject: [PATCH 02/11] Add url to request upload --- dot-commands/request.js | 23 +++++++++++++++-------- functions.js | 4 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/dot-commands/request.js b/dot-commands/request.js index 8f9c2ca..198b2cb 100644 --- a/dot-commands/request.js +++ b/dot-commands/request.js @@ -5,13 +5,20 @@ module.exports = { description: 'Submit a request to the bot developer.', usage: '.request', execute(message, commandData) { - const request = commandData.args; - commandData.content = `Your request has been submitted!\nRequest: ${request}`; - message.reply(fn.embeds.text(commandData)); - commandData.content = `A new request has been submitted by ${message.author.tag}:\n${commandData.args}`; - message.client.users.fetch(process.env.ownerID).then(user => { - user.send(fn.embeds.text(commandData)); - }).catch(error => { console.error(error); }); - fn.upload.request(commandData, message.client); + // Get the request information from the command data that was passed in + const requestText = commandData.args; + const messageUrl = message.url; + const requester = message.author.username; + + try { + fn.upload.request(requester, requestText, messageUrl, message.client); + // Set the content to sent a text embed notifying the user of success + commandData.content = `Your request has been submitted!\nRequest: ${request}`; + message.reply(fn.embeds.text(commandData)); + } catch(err) { + console.error(err); + commandData.content = "An error occurred while saving the request, please try again later."; + message.reply(fn.embeds.text(commandData)); + } }, }; \ No newline at end of file diff --git a/functions.js b/functions.js index 56fb994..7061a53 100644 --- a/functions.js +++ b/functions.js @@ -467,8 +467,8 @@ const functions = { }, }, upload: { - request(commandData, client) { - const query = `INSERT INTO requests (author, request, status) VALUES (${db.escape(commandData.author)},${db.escape(commandData.args)},'Active')`; + request(requester, requestText, messageUrl, client) { + const query = `INSERT INTO requests (author, request, status, url) VALUES (${db.escape(requester)},${db.escape(requestText)},'Active',${db.escape(messageUrl)})`; db.query(query, (err, rows, fields) => { if (err) throw err; functions.download.requests(client); From 23a282a8a56904b3769ad06943780463919cc609 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 12:19:19 -0400 Subject: [PATCH 03/11] Fix var reference in reply text --- dot-commands/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot-commands/request.js b/dot-commands/request.js index 198b2cb..67f2a7a 100644 --- a/dot-commands/request.js +++ b/dot-commands/request.js @@ -13,7 +13,7 @@ module.exports = { try { fn.upload.request(requester, requestText, messageUrl, message.client); // Set the content to sent a text embed notifying the user of success - commandData.content = `Your request has been submitted!\nRequest: ${request}`; + commandData.content = `Your request has been submitted!\nRequest: ${requestText}`; message.reply(fn.embeds.text(commandData)); } catch(err) { console.error(err); From acfe540148a74b84f7537ba3c238ecbc009abfb0 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 13:15:28 -0400 Subject: [PATCH 04/11] Add error alerting in Discord, revert last fix to test alerting --- dot-commands/request.js | 11 ++++++++--- functions.js | 28 +++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/dot-commands/request.js b/dot-commands/request.js index 67f2a7a..1bf7f82 100644 --- a/dot-commands/request.js +++ b/dot-commands/request.js @@ -13,12 +13,17 @@ module.exports = { try { fn.upload.request(requester, requestText, messageUrl, message.client); // Set the content to sent a text embed notifying the user of success - commandData.content = `Your request has been submitted!\nRequest: ${requestText}`; - message.reply(fn.embeds.text(commandData)); + commandData.content = `Your request has been submitted!\nRequest: ${request}`; + const replyEmbed = fn.embeds.text(commandData); + message.reply({ embeds: [ replyEmbed ]}); } catch(err) { console.error(err); commandData.content = "An error occurred while saving the request, please try again later."; - message.reply(fn.embeds.text(commandData)); + const replyEmbed = fn.embeds.text(commandData); + message.reply({ embeds: [ replyEmbed ]}); + + const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${JSON.stringify(err)}`); + fn.sendAlert(errorEmbed); } }, }; \ No newline at end of file diff --git a/functions.js b/functions.js index 7061a53..b83bff7 100644 --- a/functions.js +++ b/functions.js @@ -9,6 +9,7 @@ const dbPass = process.env.dbPass; const dbPort = process.env.dbPort; const isDev = process.env.isDev; const ownerId = process.env.ownerId; +const statusChannelId = process.env.statusChannelId; // filesystem const fs = require('fs'); @@ -302,11 +303,13 @@ const functions = { return { embeds: [jointsEmbed], components: [jointsPageAR], ephemeral: true }; }, text(commandData) { - return { embeds: [new Discord.MessageEmbed() - .setAuthor({name: commandData.command}) + const textEmbed = new Discord.MessageEmbed() + .setAuthor({ name: commandData.command }) .setDescription(commandData.content) .setTimestamp() - .setFooter({text: commandData.author})]}; + .setFooter({text: commandData.author}); + + return textEmbed; }, requests(commandData, indexedRequests) { const requestsEmbed = new Discord.MessageEmbed() @@ -458,6 +461,14 @@ const functions = { .setDescription('* Data Collection – NodBot does collect personal data, including but not limited to: location, IP address, MAC address, physical address, mother\'s maiden name, social security number, credit card numbers, phone fingerprints, physical fingerprints, penis length and girth, first pet\'s name, city where you met your spouse, and city where your parents met.\n* Payment Info – All payments are processed through a sketchy-looking PayPal link. NodBot and voidf1sh take no responsibility if your bank, CPA, lawyer, or local PD calls you afterward.\n* Chat Logs – NodBot may or may not remember every dumbass thing you’ve ever typed. Just assume it does.\n* Third-Party Sharing – Your usage data may be shared with savage\'s mom\n* Right to Be Forgotten – You can request NodBot forget your existence, but that requires a one-time processing fee of $50.'); return { content: announcement, embeds: [ embed1, embed2 ] }; + }, + error(errorText) { + const errorEmbed = new Discord.MessageEmbed() + .setAuthor({ name: "Error!" }) + .setDescription({ text: errorText }) + .setFooter({ text: appVersion }); + + return errorEmbed; } }, collect: { @@ -909,6 +920,17 @@ const functions = { } const errorId = digits.join(""); return errorId; + }, + async sendAlert(embed) { + const statusChannel = await client.channels.fetch(statusChannelId) + .catch(err => { + console.error(err); + }); + + await statusChannel.send({ embeds: [ embed ] }) + .catch(err => { + console.error(err); + }); } }; From f7c63c8705af9896a787f29a767d7ed4194ad1a0 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 14:30:48 -0400 Subject: [PATCH 05/11] Tweak dev and prod workflow --- .gitea/workflows/dev-docker.yml | 2 +- .gitea/workflows/production-docker.yml | 2 +- Dockerfile | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/dev-docker.yml b/.gitea/workflows/dev-docker.yml index 4dafc2d..f92994f 100644 --- a/.gitea/workflows/dev-docker.yml +++ b/.gitea/workflows/dev-docker.yml @@ -34,7 +34,7 @@ jobs: - name: Build the Docker image run: | cd /var/lib/act_runner/nodbot - docker build . --file Dockerfile --tag v0idf1sh/nodbot-dev + docker build --target dev . --file Dockerfile --tag v0idf1sh/nodbot - name: Log into Docker Hub run: docker login -u $DHUB_UNAME -p $DHUB_PWORD - name: Push image to Docker Hub diff --git a/.gitea/workflows/production-docker.yml b/.gitea/workflows/production-docker.yml index c405566..460ab4f 100644 --- a/.gitea/workflows/production-docker.yml +++ b/.gitea/workflows/production-docker.yml @@ -33,7 +33,7 @@ jobs: - name: Build the Docker image run: | cd /var/lib/act_runner/nodbot - docker build . --file Dockerfile --tag v0idf1sh/nodbot + docker build --target prod . --file Dockerfile --tag v0idf1sh/nodbot - name: Log into Docker Hub run: docker login -u $DHUB_UNAME -p $DHUB_PWORD - name: Push image to Docker Hub diff --git a/Dockerfile b/Dockerfile index b10bc75..3a5760c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18 +FROM node:18 AS prod RUN mkdir -p /usr/src/app WORKDIR /usr/src/app @@ -6,4 +6,15 @@ COPY package.json ./ RUN npm install COPY . . # CMD ["/bin/sh", "-c", "node main.js 2> /logs/nodbot.error 1> /logs/nodbot.log"] -CMD ["/bin/sh", "-c", "node main.js 2> /logs/$(date +%Y-%m-%d_%H-%M-%S)-error.txt 1> /logs/$(date +%Y-%m-%d_%H-%M-%S)-status.txt"] \ No newline at end of file +CMD ["/bin/sh", "-c", "node main.js 2> /logs/$(date +%Y-%m-%d_%H-%M-%S)-error.txt 1> /logs/$(date +%Y-%m-%d_%H-%M-%S)-status.txt"] + +# Dev Build +FROM node:18 AS dev +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY package.json ./ +RUN npm install +COPY . . +# Invoke the bot without redirecting STDOUT and STDERR so that docker logs can be used. +CMD ["/bin/sh", "-c", "node main.js"] \ No newline at end of file From 531167f2ba8132fc47f6df3901b663ba93d4160f Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 14:39:12 -0400 Subject: [PATCH 06/11] Add specific target to push in CI flow --- .gitea/workflows/dev-docker.yml | 2 +- .gitea/workflows/production-docker.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/dev-docker.yml b/.gitea/workflows/dev-docker.yml index f92994f..04aec85 100644 --- a/.gitea/workflows/dev-docker.yml +++ b/.gitea/workflows/dev-docker.yml @@ -40,7 +40,7 @@ jobs: - name: Push image to Docker Hub run: | cd /var/lib/act_runner/nodbot - docker push v0idf1sh/nodbot-dev + docker push v0idf1sh/nodbot:dev - name: Restart the container run: | cd /srv/docker/nodbot-dev diff --git a/.gitea/workflows/production-docker.yml b/.gitea/workflows/production-docker.yml index 460ab4f..e671884 100644 --- a/.gitea/workflows/production-docker.yml +++ b/.gitea/workflows/production-docker.yml @@ -39,7 +39,7 @@ jobs: - name: Push image to Docker Hub run: | cd /var/lib/act_runner/nodbot - docker push v0idf1sh/nodbot + docker push v0idf1sh/nodbot:prod - name: Restart the container run: | cd /srv/docker/nodbot From 211e07f5f0c0edb51d5ae5ed013261e7d50c9d04 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 15:15:09 -0400 Subject: [PATCH 07/11] Fix tagging system --- .gitea/workflows/dev-docker.yml | 2 +- .gitea/workflows/production-docker.yml | 2 +- Dockerfile | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/dev-docker.yml b/.gitea/workflows/dev-docker.yml index 04aec85..9a84d3a 100644 --- a/.gitea/workflows/dev-docker.yml +++ b/.gitea/workflows/dev-docker.yml @@ -34,7 +34,7 @@ jobs: - name: Build the Docker image run: | cd /var/lib/act_runner/nodbot - docker build --target dev . --file Dockerfile --tag v0idf1sh/nodbot + docker build --target dev . --file Dockerfile --tag v0idf1sh/nodbot:dev - name: Log into Docker Hub run: docker login -u $DHUB_UNAME -p $DHUB_PWORD - name: Push image to Docker Hub diff --git a/.gitea/workflows/production-docker.yml b/.gitea/workflows/production-docker.yml index e671884..ff4f6ac 100644 --- a/.gitea/workflows/production-docker.yml +++ b/.gitea/workflows/production-docker.yml @@ -33,7 +33,7 @@ jobs: - name: Build the Docker image run: | cd /var/lib/act_runner/nodbot - docker build --target prod . --file Dockerfile --tag v0idf1sh/nodbot + docker build --target prod . --file Dockerfile --tag v0idf1sh/nodbot:prod - name: Log into Docker Hub run: docker login -u $DHUB_UNAME -p $DHUB_PWORD - name: Push image to Docker Hub diff --git a/Dockerfile b/Dockerfile index 3a5760c..a977f65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,3 @@ -FROM node:18 AS prod -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -COPY package.json ./ -RUN npm install -COPY . . -# CMD ["/bin/sh", "-c", "node main.js 2> /logs/nodbot.error 1> /logs/nodbot.log"] -CMD ["/bin/sh", "-c", "node main.js 2> /logs/$(date +%Y-%m-%d_%H-%M-%S)-error.txt 1> /logs/$(date +%Y-%m-%d_%H-%M-%S)-status.txt"] - # Dev Build FROM node:18 AS dev RUN mkdir -p /usr/src/app @@ -17,4 +7,14 @@ COPY package.json ./ RUN npm install COPY . . # Invoke the bot without redirecting STDOUT and STDERR so that docker logs can be used. -CMD ["/bin/sh", "-c", "node main.js"] \ No newline at end of file +CMD ["/bin/sh", "-c", "node main.js"] + +FROM node:18 AS prod +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY package.json ./ +RUN npm install +COPY . . +# CMD ["/bin/sh", "-c", "node main.js 2> /logs/nodbot.error 1> /logs/nodbot.log"] +CMD ["/bin/sh", "-c", "node main.js 2> /logs/$(date +%Y-%m-%d_%H-%M-%S)-error.txt 1> /logs/$(date +%Y-%m-%d_%H-%M-%S)-status.txt"] \ No newline at end of file From 8580dda6c87eaa02c9faf2fff927bf41ceae83c3 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 15:25:53 -0400 Subject: [PATCH 08/11] Change MessageEmbed Description to just a string --- functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.js b/functions.js index b83bff7..5fb910e 100644 --- a/functions.js +++ b/functions.js @@ -465,7 +465,7 @@ const functions = { error(errorText) { const errorEmbed = new Discord.MessageEmbed() .setAuthor({ name: "Error!" }) - .setDescription({ text: errorText }) + .setDescription(errorText) .setFooter({ text: appVersion }); return errorEmbed; From 46e5079eafffd43d1ed6c801665125d2218d7459 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 15:28:03 -0400 Subject: [PATCH 09/11] Add client to sendAlert --- dot-commands/request.js | 2 +- functions.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dot-commands/request.js b/dot-commands/request.js index 1bf7f82..e25644f 100644 --- a/dot-commands/request.js +++ b/dot-commands/request.js @@ -23,7 +23,7 @@ module.exports = { message.reply({ embeds: [ replyEmbed ]}); const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${JSON.stringify(err)}`); - fn.sendAlert(errorEmbed); + fn.sendAlert(errorEmbed, message.client); } }, }; \ No newline at end of file diff --git a/functions.js b/functions.js index 5fb910e..3ea1706 100644 --- a/functions.js +++ b/functions.js @@ -921,7 +921,7 @@ const functions = { const errorId = digits.join(""); return errorId; }, - async sendAlert(embed) { + async sendAlert(embed, client) { const statusChannel = await client.channels.fetch(statusChannelId) .catch(err => { console.error(err); From 8039f8f1c7c49ee5acf08bfe1114aaa2c59a0692 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 15:30:45 -0400 Subject: [PATCH 10/11] Print raw error instead of trying to stringify it --- dot-commands/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot-commands/request.js b/dot-commands/request.js index e25644f..f4428e7 100644 --- a/dot-commands/request.js +++ b/dot-commands/request.js @@ -22,7 +22,7 @@ module.exports = { const replyEmbed = fn.embeds.text(commandData); message.reply({ embeds: [ replyEmbed ]}); - const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${JSON.stringify(err)}`); + const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${err}`); fn.sendAlert(errorEmbed, message.client); } }, From 7b504a23122c69e1441f35a25e19a861e9e8d7bd Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 15:32:38 -0400 Subject: [PATCH 11/11] Re-fix variable ref --- dot-commands/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot-commands/request.js b/dot-commands/request.js index f4428e7..41ce37f 100644 --- a/dot-commands/request.js +++ b/dot-commands/request.js @@ -13,7 +13,7 @@ module.exports = { try { fn.upload.request(requester, requestText, messageUrl, message.client); // Set the content to sent a text embed notifying the user of success - commandData.content = `Your request has been submitted!\nRequest: ${request}`; + commandData.content = `Your request has been submitted!\nRequest: ${requestText}`; const replyEmbed = fn.embeds.text(commandData); message.reply({ embeds: [ replyEmbed ]}); } catch(err) {