Move to /view
All checks were successful
NodBot Production Dockerization / build (pull_request) Successful in 9s

This commit is contained in:
Skylar Grant 2024-09-29 12:28:29 -04:00
parent e843275ba1
commit 0e34a0a4bb
6 changed files with 36 additions and 19 deletions

View File

@ -2,7 +2,6 @@ const customEmbeds = require('../CustomModules/Embeds.js');
const InteractionStorage = require('../CustomModules/InteractionStorage.js');
const indexer = require('../CustomModules/Indexer.js');
const fn = require('../functions.js');
const requests = require('../slash-commands/requests.js');
const { GifData } = require('./NodBot.js');
module.exports = {

View File

@ -50,14 +50,15 @@ module.exports = {
// Code Here...
const subcommand = interaction.options.getSubcommand();
const iStorage = interaction.client.iStorage.get(interaction.id);
let commandData = {
author: interaction.user.username
}
const commandData = {
author: interaction.user.username,
command: `/${interaction.commandName} ${subcommand}`
};
switch (subcommand) {
// GIFs
case "gifs":
if (!interaction.client.gifs) {
interaction.reply('For some reason I don\'t have access to the collection of gifs. Sorry about that!');
interaction.editReply('For some reason I don\'t have access to the collection of gifs. Sorry about that!');
return;
}
let indexedGifs = Indexer(interaction.client.gifs, 0);
@ -68,20 +69,15 @@ module.exports = {
for (const gif of indexedGifs.thisPage) {
indexedGifs.gifsString += `[${gif.name}.gif](${gif.url})\n`;
}
const commandData = {
command: "/gifs",
author: interaction.user.username
};
interaction.reply(fn.embeds.gifs(commandData, indexedGifs));
interaction.editReply(fn.embeds.gifs(commandData, indexedGifs));
break;
// Joints
case "joints":
if (!interaction.client.joints) {
interaction.reply('For some reason I don\'t have access to the collection of joints. Sorry about that!');
interaction.editReply('For some reason I don\'t have access to the collection of joints. Sorry about that!');
return;
}
let iStorage = interaction.client.iStorage.get(interaction.id);
let indexedJoints = indexer(interaction.client.joints, 0);
let indexedJoints = Indexer(interaction.client.joints, 0);
indexedJoints.jointsString = new String();
iStorage.page = 0;
@ -89,17 +85,39 @@ module.exports = {
for (const joint of indexedJoints.thisPage) {
indexedJoints.jointsString += `${joint.content}\n`;
}
const commandData = {
command: "/joints",
author: interaction.user.username
};
interaction.reply(fn.embeds.joints(commandData, indexedJoints));
interaction.editReply(fn.embeds.joints(commandData, indexedJoints));
break;
// Pastas
case "pastas":
if (!interaction.client.pastas) {
interaction.editReply({ content: 'For some reason I don\'t have access to the collection of copypastas. Sorry about that!', ephemeral: true });
return;
}
let indexedPastas = Indexer(interaction.client.pastas, 0);
indexedPastas.pastasString = new String();
iStorage.page = 0;
for (const pasta of indexedPastas.thisPage) {
indexedPastas.pastasString += `${pasta.name}.pasta\n`;
}
interaction.editReply(fn.embeds.pastas(commandData, indexedPastas));
break;
// Requests
case "requests":
if (!interaction.client.requests) {
interaction.editReply('For some reason I don\'t have access to the collection of requests. Sorry about that!');
return;
}
let indexedRequests = Indexer(interaction.client.requests, 0);
indexedRequests.requestsString = new String();
iStorage.page = 0;
for (const request of indexedRequests.thisPage) {
indexedRequests.requestsString += `[${request.id}]: ${request.request} (submitted by ${request.author})\n`;
}
interaction.editReply(fn.embeds.requests(commandData, indexedRequests));
break;
// Default
default: