WIP: v3.4.0 #25
@ -1,30 +0,0 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
const { config } = require('dotenv');
|
||||
const fn = require('../functions.js');
|
||||
const indexer = require('../CustomModules/Indexer.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('gifs')
|
||||
.setDescription('Get a list of currently saved GIFs.'),
|
||||
execute(interaction) {
|
||||
if (!interaction.client.gifs) {
|
||||
interaction.reply('For some reason I don\'t have access to the collection of gifs. Sorry about that!');
|
||||
return;
|
||||
}
|
||||
let iStorage = interaction.client.iStorage.get(interaction.id);
|
||||
let indexedGifs = indexer(interaction.client.gifs, 0);
|
||||
indexedGifs.gifsString = new String();
|
||||
|
||||
iStorage.page = 0;
|
||||
|
||||
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));
|
||||
}
|
||||
};
|
@ -1,29 +0,0 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
const fn = require('../functions.js');
|
||||
const indexer = require('../CustomModules/Indexer.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('joints')
|
||||
.setDescription('Send a list of all the /joint phrases.'),
|
||||
async execute(interaction) {
|
||||
if (!interaction.client.joints) {
|
||||
interaction.reply('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);
|
||||
indexedJoints.jointsString = new String();
|
||||
|
||||
iStorage.page = 0;
|
||||
|
||||
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));
|
||||
},
|
||||
};
|
@ -1,30 +0,0 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
const { config } = require('dotenv');
|
||||
const fn = require('../functions.js');
|
||||
const indexer = require('../CustomModules/Indexer.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('pastas')
|
||||
.setDescription('Get a list of currently saved copypastas.'),
|
||||
async execute(interaction) {
|
||||
if (!interaction.client.pastas) {
|
||||
interaction.reply({ content: 'For some reason I don\'t have access to the collection of copypastas. Sorry about that!', ephemeral: true });
|
||||
return;
|
||||
}
|
||||
let iStorage = interaction.client.iStorage.get(interaction.id);
|
||||
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`;
|
||||
}
|
||||
const commandData = {
|
||||
command: "/pastas",
|
||||
author: interaction.user.username
|
||||
};
|
||||
interaction.reply(fn.embeds.pastas(commandData, indexedPastas));
|
||||
},
|
||||
};
|
@ -1,31 +0,0 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
const { config } = require('dotenv');
|
||||
const fn = require('../functions.js');
|
||||
const indexer = require('../CustomModules/Indexer.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('requests')
|
||||
.setDescription('Get a list of Active requests from the database'),
|
||||
async execute(interaction) {
|
||||
if (!interaction.client.requests) {
|
||||
interaction.reply('For some reason I don\'t have access to the collection of requests. Sorry about that!');
|
||||
return;
|
||||
}
|
||||
let iStorage = interaction.client.iStorage.get(interaction.id);
|
||||
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`;
|
||||
}
|
||||
|
||||
const commandData = {
|
||||
command: "/requests",
|
||||
author: interaction.user.username
|
||||
};
|
||||
interaction.reply(fn.embeds.requests(commandData, indexedRequests));
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue
Block a user