WIP: v3.4.0 #25

Draft
voidf1sh wants to merge 21 commits from v3.4.0 into main
3 changed files with 79 additions and 1 deletions
Showing only changes of commit 7f876f4555 - Show all commits

View File

@ -0,0 +1,45 @@
name: NodBot PE Dockerization
on:
push:
tags:
- 'v*-dev*'
env:
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
jobs:
build:
runs-on: self-hosted
steps:
- name: Pull latest from Git
run: |
echo "Branch: ${{ gitea.ref_name }}"
pwd
whoami
mkdir -p /var/lib/act_runner/
cd /var/lib/act_runner/
if [ ! -d "nodbot" ]; then
git clone https://git.vfsh.dev/voidf1sh/nodbot-dev
cd nodbot-dev
else
cd nodbot-dev
git pull
fi
git checkout ${{ gitea.ref_name }}
- name: Build the Docker image
run: |
cd /var/lib/act_runner/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-dev
docker push v0idf1sh/nodbot-dev
- name: Restart the container
run: |
cd /srv/docker/nodbot-dev
docker-compose down
docker-compose up -d

View File

@ -52,6 +52,9 @@ module.exports = {
case 'cancelGif':
module.exports.gifSearchPage(interaction);
break;
case 'closeRequests':
module.exports.closeRequests(interaction);
break;
default:
return;
}
@ -199,5 +202,10 @@ module.exports = {
const gifEmbed = customEmbeds.core.gifSearch({ author: interaction.user.username }, indexedGifs);
// Update the interaction
interaction.update({ embeds: [gifEmbed], components: [gifSearchAR], ephemeral: true });
},
closeRequests(interaction) {
const closeRequestModal = customEmbeds.modals.closeRequestsModal();
interaction.showModal(closeRequestModal);
interaction.update({ content: 'The requests menu has been closed.', components: [] });
}
}

View File

@ -1,4 +1,4 @@
const { MessageActionRow, MessageButton, MessageEmbed } = require('discord.js');
const { MessageActionRow, MessageButton, MessageEmbed, TextInputComponent } = require('discord.js');
module.exports = {
actionRows: {
@ -74,6 +74,11 @@ module.exports = {
.setLabel('➡️')
.setStyle('SECONDARY');
const closeButton = new MessageButton()
.setCustomId('closeRequests')
.setLabel('Close Requests')
.setStyle('DANGER');
switch (state) {
case 'first':
previousButton.setDisabled(true);
@ -138,6 +143,26 @@ module.exports = {
.addComponents(previousButton, nextButton);
}
},
modals: {
closeRequestsModal() {
const requestNumberInput = new TextInputComponent()
.setCustomId('requestNumber')
.setLabel('Request Number')
.setPlaceholder('420')
.setMinLength(1)
.setMaxLength(5)
.setStyle('SHORT')
.setRequired(true);
const actionRow = new MessageActionRow()
.addComponents([requestNumberInput]);
return new Modal()
.setTitle('Close Request')
.setDescription('Please enter the number of the request you would like to close.')
.addComponents([actionRow]);
}
},
core: {
gifSearch(commandData, indexedGifs) {
return new MessageEmbed()