Compare commits

..

2 commits

Author SHA1 Message Date
995634a4b2 Limit videos to 480p 2024-01-28 22:11:33 +01:00
3464736d85 Fix anything triggering boolean options in commands 2024-01-28 21:55:19 +01:00
2 changed files with 6 additions and 3 deletions

View file

@ -30,7 +30,7 @@ export default {
await interaction.deferReply({ ephemeral: true }); await interaction.deferReply({ ephemeral: true });
utils.downloadVideo(url, interaction.id, 'mp4') utils.downloadVideo(url, interaction.id, 'bestvideo[height<=?480]+bestaudio/best')
.then(async () => { .then(async () => {
const file = fs.readdirSync(os.tmpdir()).filter(fn => fn.startsWith(interaction.id)); const file = fs.readdirSync(os.tmpdir()).filter(fn => fn.startsWith(interaction.id));
const output = `${os.tmpdir()}/${file}`; const output = `${os.tmpdir()}/${file}`;

View file

@ -411,13 +411,16 @@ export default {
payload = messageArgs.slice(i).join(' '); payload = messageArgs.slice(i).join(' ');
} }
if (messageArgs[i].startsWith('--')) { if (arg.type === ApplicationCommandOptionType.Boolean && !messageArgs[i].startsWith('--')) {
continue;
}
else if (messageArgs[i].startsWith('--')) {
payloadName = payload.substring(2); payloadName = payload.substring(2);
payload = true; payload = true;
j--; j--;
} }
if (arg.type === ApplicationCommandOptionType.Mentionable) { if (arg.type === ApplicationCommandOptionType.Mentionable || arg.type === ApplicationCommandOptionType.User) {
await message.guild.members.fetch(); await message.guild.members.fetch();
payload = message.mentions.members.first() ? message.mentions.members.first() : message.guild.members.cache.find(u => u.user.username.toLowerCase().includes(payload.toLowerCase())); payload = message.mentions.members.first() ? message.mentions.members.first() : message.guild.members.cache.find(u => u.user.username.toLowerCase().includes(payload.toLowerCase()));
} }