Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangzaoh authored Apr 23, 2024
1 parent 6175fc8 commit 73b50b6
Show file tree
Hide file tree
Showing 15 changed files with 15,633 additions and 0 deletions.
1,138 changes: 1,138 additions & 0 deletions plugins/ai.js

Large diffs are not rendered by default.

845 changes: 845 additions & 0 deletions plugins/converter.js

Large diffs are not rendered by default.

1,490 changes: 1,490 additions & 0 deletions plugins/downloader.js

Large diffs are not rendered by default.

161 changes: 161 additions & 0 deletions plugins/editorpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
let baseApi =
process.env.API_SMD || global.api_smd || "https://api-smd-1.vercel.app";

const {
smd,
prefix,
Config,
createUrl,
photoEditor,
smdBuffer,
} = require("../lib");
let photo = ["imageMessage"];

let gfxold = [
"ad",
"uncover",
"clown",
"mnm",
"pet",
"drip",
"gun",
"colorify",
];

let gfxx = [
"beautiful",
"blur",
"facepalm",
"invert",
"rainbow",
"wanted",
"wasted",
"greyscale",
"sepia",
"rip",
"trash",
"hitler",
"jail",
"shit",
"affect",
...gfxold,
];

const sendEditor = async (
m,
cmd,
error = true,
cap = Config.caption?.split("\n")[0] || ""
) => {
if (!gfxx.includes(cmd)) return;
try {
let mm = m.image
? m
: m.reply_message && m.reply_message.image
? m.reply_message
: false;
if (!mm || !photo.includes(mm.mtype2))
return m.reply(`*_Uhh Dear, Reply To An Image!_*`);
let media = await m.bot.downloadAndSaveMediaMessage(mm);
var anu = "";
try {
anu = (await createUrl(media, "uguMashi")).url;
if (!anu) throw new Error("invalid Media!");
} catch (e) {
console.log(e);
try {
anu = await createUrl(media);
} catch (e) {
anu = false;
}
}
try {
fs.unlink(media);
} catch (e) {}
if (!anu) return m.reply("*_Failed To Create Url!_*");
let base = await smdBuffer(`${baseApi}/api/maker/${cmd}?url=${anu}`);

m.send(base, { caption: cap }, "img", mm);
} catch (e) {
if (error) {
console.log(e);
await m.error(`${e}\n\ncommand ${cmd}`, e, false);
}
}
};

for (let i = 0; i < gfxx.length; i++) {
smd(
{
cmdname: gfxx[i],
infocmd: `Edit image with ${gfxx[i]} effect!`,
type: "editor",
use: "< image >",
filename: __filename,
},
async (m, text, { smd }) => {
try {
if (gfxold.includes(smd)) {
await photoEditor(m, smd);
} else {
sendEditor(m, smd);
}
} catch (err) {
await message.error(
`${err}\n\ncommand: ${smd}`,
err,
"Request Denied!"
);
}
}
);
}

smd(
{
cmdname: "editor",
infocmd: "create gfx logo for text",
type: "editor",
use: "< image >",
filename: __filename,
},
async (m, text, { smd }) => {
try {
let mm = m.image
? m
: m.reply_message && m.reply_message.image
? m.reply_message
: false;

let too = `*Separate the text with _:_ sign!*\n*Example : ${
prefix + smd
} Suhail _:_ Bot*`;
if (!mm) {
let str = `┌───〈 *ᴇᴅɪᴛᴏʀ ᴍᴇɴᴜ* 〉───◆
│╭─────────────···▸
┴│▸
⬡│▸ ${gfxx.join(" \n⬡│▸ ")}
┬│▸
│╰────────────···▸▸
└───────────────···▸
\t *USE: _${prefix + smd}_ by replying image*
_To get All Results with single Cmd!_
`;
return await m.sendUi(m.chat, { caption: str });
}

for (let i = 0; i < gfxx.length; i++) {
try {
if (gfxold.includes(gfxx[i])) {
await photoEditor(m, gfxx[i]);
} else {
sendEditor(m, gfxx[i], false);
}
} catch (e) {}
}
} catch (e) {
m.error(`${e}\n\nCommand: ${smd}`, e, false);
}
}
);
Loading

0 comments on commit 73b50b6

Please sign in to comment.