Compare commits

..

No commits in common. "56768640ac96358b3d3e6eba216007a3dbfff069" and "1eb3b8a01398f38af72746fc256692d27d0b2992" have entirely different histories.

12 changed files with 35 additions and 57 deletions

View file

@ -19,13 +19,13 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`yes${interaction.user.id}`) .setCustomId('yes')
.setLabel('Yes') .setLabel('Yes')
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`no${interaction.user.id}`) .setCustomId('no')
.setLabel('No') .setLabel('No')
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
); );
@ -36,7 +36,7 @@ export default {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
interactionMenu.update({ components: [] }); interactionMenu.update({ components: [] });
if (interactionMenu.customId === `yes${interaction.user.id}`) { if (interactionMenu.customId === 'yes') {
const body = { serverID: interaction.guild.id, stat: 'disable' }; const body = { serverID: interaction.guild.id, stat: 'disable' };
await db.autoresponseStat.update(body, { where: { serverID: interaction.guild.id } }); await db.autoresponseStat.update(body, { where: { serverID: interaction.guild.id } });
return interaction.editReply({ content: 'Auto response has been disabled.', ephemeral: true }); return interaction.editReply({ content: 'Auto response has been disabled.', ephemeral: true });

View file

@ -25,19 +25,19 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`edit${interaction.user.id}`) .setCustomId('edit')
.setLabel('Edit') .setLabel('Edit')
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`remove${interaction.user.id}`) .setCustomId('remove')
.setLabel('Remove') .setLabel('Remove')
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`nothing${interaction.user.id}`) .setCustomId('nothing')
.setLabel('Do nothing') .setLabel('Do nothing')
.setStyle(ButtonStyle.Secondary), .setStyle(ButtonStyle.Secondary),
); );
@ -48,7 +48,7 @@ export default {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
interactionMenu.update({ components: [] }); interactionMenu.update({ components: [] });
if (interactionMenu.customId === `edit${interaction.user.id}`) { if (interactionMenu.customId === 'edit') {
if (!args.message) { if (!args.message) {
return interaction.reply({ content: 'You need to input a message for me to edit!', ephemeral: true }); return interaction.reply({ content: 'You need to input a message for me to edit!', ephemeral: true });
} }
@ -56,7 +56,7 @@ export default {
await db.leaveChannel.update(body, { where: { guildID: interaction.guild.id } }); await db.leaveChannel.update(body, { where: { guildID: interaction.guild.id } });
return interaction.editReply({ content: `The leave message has been set to ${args.message}`, ephemeral: true }); return interaction.editReply({ content: `The leave message has been set to ${args.message}`, ephemeral: true });
} }
else if (interactionMenu.customId === `remove${interaction.user.id}`) { else if (interactionMenu.customId === 'remove') {
db.leaveChannel.destroy({ where: { guildID: interaction.guild.id, channelID: interaction.channel.id } }); db.leaveChannel.destroy({ where: { guildID: interaction.guild.id, channelID: interaction.channel.id } });
return interaction.editReply({ content: 'The leave message has been deleted.', ephemeral: true }); return interaction.editReply({ content: 'The leave message has been deleted.', ephemeral: true });
} }

View file

@ -19,13 +19,13 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`yes${interaction.user.id}`) .setCustomId('yes')
.setLabel('Yes') .setLabel('Yes')
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`no${interaction.user.id}`) .setCustomId('no')
.setLabel('No') .setLabel('No')
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
); );
@ -36,7 +36,7 @@ export default {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
interactionMenu.update({ components: [] }); interactionMenu.update({ components: [] });
if (interactionMenu.customId === `yes${interaction.user.id}`) { if (interactionMenu.customId === 'yes') {
const body = { serverID: interaction.guild.id, stat: 'disable' }; const body = { serverID: interaction.guild.id, stat: 'disable' };
await db.quotationStat.update(body, { where: { serverID: interaction.guild.id } }); await db.quotationStat.update(body, { where: { serverID: interaction.guild.id } });
return interaction.editReply({ content: 'Quotation has been disabled.', ephemeral: true }); return interaction.editReply({ content: 'Quotation has been disabled.', ephemeral: true });

View file

@ -26,19 +26,19 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`edit${interaction.user.id}`) .setCustomId('edit')
.setLabel('Edit') .setLabel('Edit')
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`remove${interaction.user.id}`) .setCustomId('remove')
.setLabel('Remove') .setLabel('Remove')
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`nothing${interaction.user.id}`) .setCustomId('nothing')
.setLabel('Do nothing') .setLabel('Do nothing')
.setStyle(ButtonStyle.Secondary), .setStyle(ButtonStyle.Secondary),
); );
@ -49,7 +49,7 @@ export default {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
interactionMenu.update({ components: [] }); interactionMenu.update({ components: [] });
if (interactionMenu.customId === `edit${interaction.user.id}`) { if (interactionMenu.customId === 'edit') {
if (!args.message) { if (!args.message) {
return interaction.reply({ content: 'You need to input a message for me to edit!', ephemeral: true }); return interaction.reply({ content: 'You need to input a message for me to edit!', ephemeral: true });
} }
@ -57,7 +57,7 @@ export default {
await db.joinChannel.update(body, { where: { guildID: interaction.guild.id } }); await db.joinChannel.update(body, { where: { guildID: interaction.guild.id } });
return interaction.editReply({ content: `The join message has been set to ${args.message}`, ephemeral: true }); return interaction.editReply({ content: `The join message has been set to ${args.message}`, ephemeral: true });
} }
else if (interactionMenu.customId === `remove${interaction.user.id}`) { else if (interactionMenu.customId === 'remove') {
db.joinChannel.destroy({ where: { guildID: interaction.guild.id, channelID: interaction.channel.id } }); db.joinChannel.destroy({ where: { guildID: interaction.guild.id, channelID: interaction.channel.id } });
return interaction.editReply({ content: 'The join message has been deleted.', ephemeral: true }); return interaction.editReply({ content: 'The join message has been deleted.', ephemeral: true });
} }

View file

@ -41,13 +41,13 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`yes${interaction.user.id}`) .setCustomId('yes')
.setLabel('Yes') .setLabel('Yes')
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`no${interaction.user.id}`) .setCustomId('no')
.setLabel('No') .setLabel('No')
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
); );
@ -58,7 +58,7 @@ export default {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
interactionMenu.update({ components: [] }); interactionMenu.update({ components: [] });
if (interactionMenu.customId === `yes${interaction.user.id}`) { if (interactionMenu.customId === 'yes') {
Blacklists.destroy({ where: { type:command, uid:userid } }); Blacklists.destroy({ where: { type:command, uid:userid } });
return interaction.editReply(`The following ID have been unblacklisted from ${command}: ${userid}`); return interaction.editReply(`The following ID have been unblacklisted from ${command}: ${userid}`);
} }

View file

@ -90,7 +90,7 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new SelectMenuBuilder() new SelectMenuBuilder()
.setCustomId(`downloadQuality${interaction.user.id}`) .setCustomId('downloadQuality')
.setPlaceholder('Nothing selected') .setPlaceholder('Nothing selected')
.setMinValues(1) .setMinValues(1)
.setMaxValues(2) .setMaxValues(2)
@ -103,7 +103,7 @@ export default {
client.on('interactionCreate', async (interactionMenu) => { client.on('interactionCreate', async (interactionMenu) => {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isSelectMenu()) return; if (!interactionMenu.isSelectMenu()) return;
if (interactionMenu.customId === `downloadQuality${interaction.user.id}`) { if (interactionMenu.customId === 'downloadQuality') {
await interactionMenu.deferReply({ ephemeral: false }); await interactionMenu.deferReply({ ephemeral: false });
download(url, interactionMenu, interaction); download(url, interactionMenu, interaction);
} }
@ -121,7 +121,7 @@ async function download(url, interaction, originalInteraction) {
.setAuthor({ name: `Downloaded by ${interaction.user.tag}`, iconURL: interaction.user.displayAvatarURL(), url: url }) .setAuthor({ name: `Downloaded by ${interaction.user.tag}`, iconURL: interaction.user.displayAvatarURL(), url: url })
.setFooter({ text: `You can get the original video by clicking on the "Downloaded by ${interaction.user.tag}" message!` }); .setFooter({ text: `You can get the original video by clicking on the "Downloaded by ${interaction.user.tag}" message!` });
if (interaction.customId === `downloadQuality${interaction.user.id}`) { if (interaction.customId === 'downloadQuality') {
format = interaction.values[0]; format = interaction.values[0];
if (interaction.values[1]) format += '+' + interaction.values[1]; if (interaction.values[1]) format += '+' + interaction.values[1];
} }
@ -148,7 +148,7 @@ async function download(url, interaction, originalInteraction) {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new SelectMenuBuilder() new SelectMenuBuilder()
.setCustomId(`preset${interaction.user.id}`) .setCustomId('preset')
.setPlaceholder('Nothing selected') .setPlaceholder('Nothing selected')
.addOptions(options), .addOptions(options),
); );
@ -158,7 +158,7 @@ async function download(url, interaction, originalInteraction) {
client.on('interactionCreate', async (interactionMenu) => { client.on('interactionCreate', async (interactionMenu) => {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isSelectMenu()) return; if (!interactionMenu.isSelectMenu()) return;
if (interactionMenu.customId === `preset${interaction.user.id}`) { if (interactionMenu.customId === 'preset') {
await interactionMenu.deferReply({ ephemeral: false }); await interactionMenu.deferReply({ ephemeral: false });
compress(file, interactionMenu, Embed); compress(file, interactionMenu, Embed);
if (interaction.isMessage) cleanUp(); if (interaction.isMessage) cleanUp();

View file

@ -10,11 +10,7 @@ export default {
.addStringOption(option => .addStringOption(option =>
option.setName('feedback') option.setName('feedback')
.setDescription('The message you want to send me.') .setDescription('The message you want to send me.')
.setRequired(true)) .setRequired(true)),
.addAttachmentOption(option =>
option.setName('image')
.setDescription('Optional attachment.')
.setRequired(false)),
category: 'utility', category: 'utility',
async execute(interaction, args) { async execute(interaction, args) {
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
@ -31,12 +27,7 @@ export default {
} }
const channel = interaction.client.channels.resolve(feedbackChannelId); const channel = interaction.client.channels.resolve(feedbackChannelId);
if (args.image) { channel.send({ embeds: [Embed] });
channel.send({ embeds: [Embed], files: [args.image] });
}
else {
channel.send({ embeds: [Embed] });
}
await interaction.reply({ content: 'Your feedback has been sent! Don\'t forget to have dm open if you want to get an answer from the dev!', ephemeral: true }); await interaction.reply({ content: 'Your feedback has been sent! Don\'t forget to have dm open if you want to get an answer from the dev!', ephemeral: true });
}, },
}; };

View file

@ -18,13 +18,13 @@ export default {
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`yes${interaction.user.id}`) .setCustomId('yes')
.setLabel('Yes') .setLabel('Yes')
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
) )
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(`no${interaction.user.id}`) .setCustomId('no')
.setLabel('No') .setLabel('No')
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
); );
@ -35,7 +35,7 @@ export default {
if (interaction.user !== interactionMenu.user) return; if (interaction.user !== interactionMenu.user) return;
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
interactionMenu.update({ components: [] }); interactionMenu.update({ components: [] });
if (interactionMenu.customId === `yes${interaction.user.id}`) { if (interactionMenu.customId === 'yes') {
await db.optout.destroy({ where: { userID: interaction.user.id } }); await db.optout.destroy({ where: { userID: interaction.user.id } });
return interaction.editReply('You have successfully been opt in'); return interaction.editReply('You have successfully been opt in');
} }

View file

@ -4,7 +4,6 @@ import fs from 'node:fs';
import os from 'node:os'; import os from 'node:os';
import path from 'node:path'; import path from 'node:path';
import { exec } from 'node:child_process'; import { exec } from 'node:child_process';
const { NODE_ENV } = process.env;
export default { export default {
@ -69,7 +68,6 @@ async function gifski(output, input) {
if (stderr) { if (stderr) {
console.error(stderr); console.error(stderr);
} }
console.log(NODE_ENV === 'development' ? stdout : null);
resolve(); resolve();
}); });
}); });
@ -84,7 +82,6 @@ async function gifsicle(input, output) {
if (stderr) { if (stderr) {
console.error(stderr); console.error(stderr);
} }
console.log(NODE_ENV === 'development' ? stdout : null);
resolve(); resolve();
}); });
}); });

View file

@ -370,17 +370,15 @@ export default {
}; };
const args = {}; const args = {};
for (let i = 0, j = 0; i < command.data.options.length; i++, j++) { for (let i = 0; i < command.data.options.length; i++) {
if (!messageArgs[i]) continue; if (!messageArgs[i]) continue;
const arg = command.data.options[j]; const arg = command.data.options[i];
const type = arg.constructor.name.toLowerCase(); const type = arg.constructor.name.toLowerCase();
let payloadName = arg.name;
let payload = messageArgs[i]; let payload = messageArgs[i];
if (messageArgs[i].startsWith('--')) { if (payload.startsWith('--')) {
payloadName = payload.substring(2); arg.name = payload.substring(2);
payload = true; payload = true;
j--;
} }
else if (type.includes('mentionable')) { else if (type.includes('mentionable')) {
payload = message.mentions.members.first(); payload = message.mentions.members.first();
@ -389,7 +387,7 @@ export default {
payload = message.attachments.first(); payload = message.attachments.first();
} }
args[payloadName] = payload; args[arg.name] = payload;
} }
await command.execute(message, args, client); await command.execute(message, args, client);
} }

View file

@ -49,11 +49,7 @@ const commands = [
.addStringOption(option => .addStringOption(option =>
option.setName('feedback') option.setName('feedback')
.setDescription('The message you want to send me.') .setDescription('The message you want to send me.')
.setRequired(true)) .setRequired(true)),
.addAttachmentOption(option =>
option.setName('image')
.setDescription('Optional attachment.')
.setRequired(false)),
new SlashCommandBuilder() new SlashCommandBuilder()
.setName('inspirobot') .setName('inspirobot')

View file

@ -1,6 +1,5 @@
import os from 'node:os'; import os from 'node:os';
import { exec } from 'node:child_process'; import { exec } from 'node:child_process';
const { NODE_ENV } = process.env;
export default { export default {
downloadVideo, downloadVideo,
@ -18,7 +17,6 @@ async function downloadVideo(urlArg, output, format = 'bestvideo*+bestaudio/best
if (stderr) { if (stderr) {
console.error(stderr); console.error(stderr);
} }
console.log(NODE_ENV === 'development' ? stdout : null);
resolve(); resolve();
}); });
}); });
@ -47,7 +45,6 @@ async function ffmpeg(command) {
if (stderr) { if (stderr) {
console.error(stderr); console.error(stderr);
} }
console.log(NODE_ENV === 'development' ? stdout : null);
resolve(); resolve();
}); });
}); });
@ -72,7 +69,6 @@ async function compressVideo(input, output, preset) {
if (stderr) { if (stderr) {
console.error(stderr); console.error(stderr);
} }
console.log(NODE_ENV === 'development' ? stdout : null);
resolve(); resolve();
}); });
}); });