Compare commits

..

No commits in common. "main" and "v3.6.1-dev0" have entirely different histories.

5 changed files with 11 additions and 49 deletions

View File

@ -34,13 +34,13 @@ jobs:
- name: Build the Docker image
run: |
cd /var/lib/act_runner/nodbot
docker build --target dev . --file Dockerfile --tag v0idf1sh/nodbot:dev
docker build . --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
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

View File

@ -33,13 +33,13 @@ jobs:
- name: Build the Docker image
run: |
cd /var/lib/act_runner/nodbot
docker build --target prod . --file Dockerfile --tag v0idf1sh/nodbot:prod
docker build . --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
run: |
cd /var/lib/act_runner/nodbot
docker push v0idf1sh/nodbot:prod
docker push v0idf1sh/nodbot
- name: Restart the container
run: |
cd /srv/docker/nodbot

View File

@ -1,15 +1,4 @@
# 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"]
FROM node:18 AS prod
FROM node:18
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

View File

@ -13,17 +13,12 @@ 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}`;
const replyEmbed = fn.embeds.text(commandData);
message.reply({ embeds: [ replyEmbed ]});
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.";
const replyEmbed = fn.embeds.text(commandData);
message.reply({ embeds: [ replyEmbed ]});
const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${err}`);
fn.sendAlert(errorEmbed, message.client);
message.reply(fn.embeds.text(commandData));
}
},
};

View File

@ -9,7 +9,6 @@ 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');
@ -303,13 +302,11 @@ const functions = {
return { embeds: [jointsEmbed], components: [jointsPageAR], ephemeral: true };
},
text(commandData) {
const textEmbed = new Discord.MessageEmbed()
return { embeds: [new Discord.MessageEmbed()
.setAuthor({name: commandData.command})
.setDescription(commandData.content)
.setTimestamp()
.setFooter({text: commandData.author});
return textEmbed;
.setFooter({text: commandData.author})]};
},
requests(commandData, indexedRequests) {
const requestsEmbed = new Discord.MessageEmbed()
@ -461,14 +458,6 @@ 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(errorText)
.setFooter({ text: appVersion });
return errorEmbed;
}
},
collect: {
@ -920,17 +909,6 @@ const functions = {
}
const errorId = digits.join("");
return errorId;
},
async sendAlert(embed, client) {
const statusChannel = await client.channels.fetch(statusChannelId)
.catch(err => {
console.error(err);
});
await statusChannel.send({ embeds: [ embed ] })
.catch(err => {
console.error(err);
});
}
};