rf: js -> ts

This commit is contained in:
Aidan 2025-04-24 18:49:51 -04:00
parent 33c9120361
commit efadb51905
32 changed files with 333 additions and 246 deletions

View file

@ -17,6 +17,4 @@ function getStrings(languageCode) {
}
}
module.exports = {
getStrings
};
export { getStrings };

View file

@ -1,14 +0,0 @@
function verifyInput(ctx, userInput, message, verifyNaN = false) {
if (!userInput || (verifyNaN && isNaN(userInput))) {
ctx.reply(message, {
parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id
});
return true;
}
return false;
}
module.exports = {
verifyInput
};

View file

@ -0,0 +1,10 @@
export default function verifyInput(ctx: any, userInput: string, message: string, verifyNaN = false) {
if (!userInput || (verifyNaN && isNaN(Number(userInput)))) { // not sure why isNaN is used here, but the input should be a number
ctx.reply(message, {
parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id
});
return true;
}
return false;
}

View file

@ -1,7 +1,7 @@
const axios = require('axios');
const fs = require('fs');
const path = require('path');
const os = require('os');
import axios from 'axios';
import fs from 'fs';
import path from 'path';
import os from 'os';
const downloadDir = path.resolve(__dirname, 'yt-dlp');