Compare commits
3 commits
1585941e8a
...
bd4dcd087e
Author | SHA1 | Date | |
---|---|---|---|
bd4dcd087e | |||
c68d4fca00 | |||
56d06cedc4 |
3 changed files with 10 additions and 10 deletions
|
@ -15,7 +15,7 @@ export default {
|
||||||
const Donator = await donator.findAll({ order: ['id'] });
|
const Donator = await donator.findAll({ order: ['id'] });
|
||||||
const client = interaction.client;
|
const client = interaction.client;
|
||||||
const tina = await client.users.fetch('336492042299637771');
|
const tina = await client.users.fetch('336492042299637771');
|
||||||
const owner = await client.users.fetch('267065637183029248');
|
const creator = await client.users.fetch('267065637183029248');
|
||||||
const maintainer = await client.users.fetch(ownerId);
|
const maintainer = await client.users.fetch(ownerId);
|
||||||
|
|
||||||
let description = 'I\'m a fun multipurpose bot made using [discord.js](https://github.com/discordjs/discord.js)'
|
let description = 'I\'m a fun multipurpose bot made using [discord.js](https://github.com/discordjs/discord.js)'
|
||||||
|
@ -55,7 +55,7 @@ export default {
|
||||||
{ name: 'Status page', value: uptimePage.toString(), inline: true },
|
{ name: 'Status page', value: uptimePage.toString(), inline: true },
|
||||||
|
|
||||||
)
|
)
|
||||||
.setFooter({ text: `Original bot made by ${owner.tag} (267065637183029248)` });
|
.setFooter({ text: `Original bot made by ${creator.tag} (267065637183029248)` });
|
||||||
|
|
||||||
interaction.reply({ embeds: [aboutEmbed] });
|
interaction.reply({ embeds: [aboutEmbed] });
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, SelectMenuBuilder } from 'discord.js';
|
import { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } from 'discord.js';
|
||||||
import { exec } from 'node:child_process';
|
import { exec } from 'node:child_process';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
|
@ -89,8 +89,8 @@ export default {
|
||||||
|
|
||||||
const row = new ActionRowBuilder()
|
const row = new ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(`downloadQuality${interaction.user.id}`)
|
.setCustomId(`downloadQuality${interaction.user.id}${interaction.id}`)
|
||||||
.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${interaction.user.id}${interaction.id}`) {
|
||||||
await interactionMenu.deferReply({ ephemeral: false });
|
await interactionMenu.deferReply({ ephemeral: false });
|
||||||
download(url, interactionMenu, interaction);
|
download(url, interactionMenu, interaction);
|
||||||
}
|
}
|
||||||
|
@ -147,8 +147,8 @@ async function download(url, interaction, originalInteraction) {
|
||||||
|
|
||||||
const row = new ActionRowBuilder()
|
const row = new ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(`preset${interaction.user.id}`)
|
.setCustomId(`preset${interaction.user.id}${interaction.id}`)
|
||||||
.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${interaction.user.id}${interaction.id}`) {
|
||||||
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();
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
};
|
};
|
||||||
async function downloadVideo(urlArg, output, format = 'bestvideo*+bestaudio/best') {
|
async function downloadVideo(urlArg, output, format = 'bestvideo*+bestaudio/best') {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
exec(`./bin/yt-dlp -f ${format} "${urlArg}" -o "${os.tmpdir()}/${output}.%(ext)s" --force-overwrites --no-playlist --merge-output-format=mp4/webm/mov`, (err, stdout, stderr) => {
|
exec(`./bin/yt-dlp -f ${format} "${urlArg}" -o "${os.tmpdir()}/${output}.%(ext)s" --force-overwrites --no-playlist --remux-video=mp4/webm/mov`, (err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(stderr);
|
reject(stderr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue