diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties deleted file mode 100644 index 3b1a22e..0000000 --- a/nbproject/private/private.properties +++ /dev/null @@ -1 +0,0 @@ -browser=Chrome.INTEGRATED diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml deleted file mode 100644 index 4750962..0000000 --- a/nbproject/private/private.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/deploy-commands.js b/src/deploy-commands.js index 0b7b816..e360e6e 100644 --- a/src/deploy-commands.js +++ b/src/deploy-commands.js @@ -6,10 +6,10 @@ const { Routes } = require('discord-api-types/v9'); const { clientId, token } = require('./helpers/env'); const commands = []; -const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); +const commandFiles = fs.readdirSync(__dirname + '/commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { - const command = require(`./commands/${file}`); + const command = require(`${__dirname}/commands/${file}`); commands.push(command.data.toJSON()); } diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 9c4f7c7..5dcc701 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -11,7 +11,7 @@ export async function execute(interaction) { const command = client.commands.get(interaction.commandName); - if (!command) return; //h + if (!command) return; try { await command.execute(interaction); @@ -20,4 +20,4 @@ export async function execute(interaction) { log({ logger: 'interaction', content: `Interaction ${interaction.name} failed!`, level: 'error' }); await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); } -} \ No newline at end of file +} diff --git a/src/helpers/util/pagination.js b/src/helpers/util/pagination.js deleted file mode 100644 index a4576cd..0000000 --- a/src/helpers/util/pagination.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.paginateInteraction = exports.paginateMessage = void 0; -const discord_js_1 = require("discord.js"); -function paginateMessage(message, embeds) { - return __awaiter(this, void 0, void 0, function* () { - let index = 0; - const row = new discord_js_1.MessageActionRow; - row.addComponents(new discord_js_1.MessageButton() - .setCustomId('paginator-left') - .setEmoji('868552005977788466') - .setStyle('SECONDARY'), new discord_js_1.MessageButton() - .setCustomId('paginator-right') - .setEmoji('868551772887711754') - .setStyle('SECONDARY')); - yield message.reply({ content: `Page 1 of ${embeds.length}:`, embeds: [embeds[index]], components: [row] }) - .then((paginatorMessage) => __awaiter(this, void 0, void 0, function* () { - const filter = m => m.author.id === message.author.id; - const paginatorCollector = paginatorMessage.createMessageComponentCollector({ componentType: 'BUTTON', filter: filter }); - paginatorCollector.on('collect', (i) => __awaiter(this, void 0, void 0, function* () { - switch (i.customId) { - case 'paginator-left': - index--; - if (index < 0) - index = embeds.length - 1; - break; - case 'paginator-right': - index++; - if (index > embeds.length - 1) - index = 0; - break; - } - paginatorMessage.edit({ content: `Page ${index + 1} of ${embeds.length}:`, embeds: [embeds[index]] }); - })); - })); - }); -} -exports.paginateMessage = paginateMessage; -function paginateInteraction(interaction, embeds) { - return __awaiter(this, void 0, void 0, function* () { - let index = 0; - const row = new discord_js_1.MessageActionRow; - row.addComponents(new discord_js_1.MessageButton() - .setCustomId('paginator-left') - .setEmoji('868552005977788466') - .setStyle('SECONDARY'), new discord_js_1.MessageButton() - .setCustomId('paginator-right') - .setEmoji('868551772887711754') - .setStyle('SECONDARY')); - yield interaction.followUp({ content: `Page 1 of ${embeds.length}:`, embeds: [embeds[index]], components: [row], fetchReply: true }) - .then((p) => __awaiter(this, void 0, void 0, function* () { - const paginatorMessage = p; - const filter = i => i.user.id === interaction.user.id; - const paginatorCollector = paginatorMessage.createMessageComponentCollector({ componentType: 'BUTTON', filter: filter }); - paginatorCollector.on('collect', (i) => __awaiter(this, void 0, void 0, function* () { - switch (i.customId) { - case 'paginator-left': - index--; - if (index < 0) - index = embeds.length - 1; - break; - case 'paginator-right': - index++; - if (index > embeds.length - 1) - index = 0; - break; - } - yield i.update({ content: `Page ${index + 1} of ${embeds.length}:`, embeds: [embeds[index]] }); - })); - })); - }); -} -exports.paginateInteraction = paginateInteraction;