From c782708fa61a3cb9949b494e896850c359c2eabf Mon Sep 17 00:00:00 2001 From: Supositware Date: Tue, 12 Dec 2023 21:21:09 +0100 Subject: [PATCH] Update some more strings --- commands/owner/ublacklist.js | 4 ++-- scripts/downloadutils.js | 4 ++-- scripts/updateytdlp.js | 22 +++++++++++++--------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/commands/owner/ublacklist.js b/commands/owner/ublacklist.js index 18b751f..24eb741 100644 --- a/commands/owner/ublacklist.js +++ b/commands/owner/ublacklist.js @@ -34,10 +34,10 @@ export default { Blacklists.create(body); let user = userid; await client.users.fetch(userid); - user = client.users.resolve(userid).tag; + user = client.users.resolve(userid).username; - return interaction.editReply(`${user} has been blacklisted from ${command} with the following reason \`${reason}\``); + return interaction.editReply(`${user} (${userid}) has been blacklisted from ${command} with the following reason \`${reason}\``); } else { const row = new ActionRowBuilder() diff --git a/scripts/downloadutils.js b/scripts/downloadutils.js index 6e158c0..148a15a 100644 --- a/scripts/downloadutils.js +++ b/scripts/downloadutils.js @@ -23,11 +23,11 @@ async function download(url, output) { fs.renameSync(tmpPath, path); fs.chmodSync(path, '755'); console.log(`${url} download finished.`); - resolve(true); + return resolve(true); }); filePath.on('error', (err) => { filePath.close(); - reject(err); + return reject(err); }); }); }); diff --git a/scripts/updateytdlp.js b/scripts/updateytdlp.js index 076146a..834d5a0 100644 --- a/scripts/updateytdlp.js +++ b/scripts/updateytdlp.js @@ -1,13 +1,17 @@ +// This is kind of useless since you can just do `./yt-dlp --update-to nightly` which I didn't know about when I wrote that. import utils from './downloadutils.js'; -if (process.platform !== 'linux' && process.argv[2] !== '-f') { - console.error('This script only download the linux version of yt-dlp. If you want to download anyway try again with -f'); - process.exit(1); -} -else if (process.platform !== 'linux' && process.argv[2] === '-f') { - console.log('Executed with -f. Reminder that this script only download the linux version of yt-dlp.'); -} +(async () => { + if (process.platform !== 'linux' && process.argv[2] !== '-f') { + console.error('This script only download the linux version of yt-dlp. If you want to download anyway try again with -f or execute ./bin/yt-dlp --update-to nightly'); + process.exit(1); + } + else if (process.platform !== 'linux' && process.argv[2] === '-f') { + console.log('Executed with -f. Reminder that this script only download the linux version of yt-dlp.'); + } -const downloadUrl = 'https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp'; + const downloadUrl = 'https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp'; -utils.download(downloadUrl, './bin/yt-dlp'); + await utils.download(downloadUrl, './bin/yt-dlp'); + +});