Skip to content

Instantly share code, notes, and snippets.

@dipto-008
Created June 16, 2025 18:02
Show Gist options
  • Save dipto-008/97b4cc5c8c8424466f388afcdef88923 to your computer and use it in GitHub Desktop.
Save dipto-008/97b4cc5c8c8424466f388afcdef88923 to your computer and use it in GitHub Desktop.
Hey noob πŸ‘‹πŸ‘‹
const axios = require("axios");
module.exports = {
config: {
name: "4k",
aliases: ["upscale"],
version: "1.1",
role: 0,
author: "Fahim_Noob",
countDown: 5,
longDescription: "Upscale images to 4K resolution.",
category: "image",
guide: {
en: "${pn} reply to an image to upscale it to 4K resolution."
}
},
onStart: async function ({ message, event }) {
if (!event.messageReply || !event.messageReply.attachments || !event.messageReply.attachments[0]) {
return message.reply("Please reply to an image to upscale it.");
}
const imgurl = encodeURIComponent(event.messageReply.attachments[0].url);
const noobs = 'xyz';
const upscaleUrl = `https://smfahim.${noobs}/4k?url=${imgurl}`;
message.reply("π™Ώπš•πšœ πš†8 π™±πš˜πšœπšœπŸ˜‰.", async (err, info) => {
try {
const { data: { image } } = await axios.get(upscaleUrl);
const attachment = await global.utils.getStreamFromURL(image, "upscaled-image.png");
message.reply({
body: "βœ…| π™·πšŽπš›πšŽ πš’πšœ π™±πš˜πšœπšœ 4πš” πšžπš™πšœπšŒπšŠπš•πšŽπš πš’πš–πš:",
attachment: attachment
});
let processingMsgID = info.messageID;
message.unsend(processingMsgID);
} catch (error) {
console.error(error);
message.reply("❌| There was an error upscaling your image.");
}
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment