Upload case.js
Browse files
case.js
CHANGED
@@ -126,7 +126,7 @@ module.exports = async (conn, dev, chatUpdate, store) => {
|
|
126 |
budy,
|
127 |
content,
|
128 |
body
|
129 |
-
} = dev
|
130 |
const isGroup = m.key.remoteJid.endsWith('@g.us');
|
131 |
const prefixFile = './database/prefix.json';
|
132 |
let prefix = '.';
|
@@ -961,18 +961,14 @@ module.exports = async (conn, dev, chatUpdate, store) => {
|
|
961 |
> ββββββββββββββ
|
962 |
|
963 |
> βγ \`πππππ πππππππππ\` γ
|
964 |
-
> ${sign} ${prefix}play
|
965 |
-
> ${sign} ${prefix}video
|
966 |
> ${sign} ${prefix}animedl
|
967 |
> ${sign} ${prefix}yts
|
968 |
-
|
969 |
-
>
|
970 |
-
|
971 |
-
>
|
972 |
-
> ${sign} ${prefix}startgame
|
973 |
-
> ${sign} ${prefix}store
|
974 |
-
> ${sign} ${prefix}buy
|
975 |
-
> ${sign} ${prefix}rank
|
976 |
> ββββββββββββββ
|
977 |
|
978 |
> βγ \`π
πππ πππππππππ\` γ
|
@@ -2842,7 +2838,7 @@ case 'play':
|
|
2842 |
},
|
2843 |
caption: fontx(`πΆ *title:* ${title}\nποΈ *views:* ${views}\nβ±οΈ *duration:* ${timestamp}\nπ
*uploaded:* ${ago}\nπ`) + (` *url:* ${url}\n`) + fontx(`\n> ${caption}`),
|
2844 |
});
|
2845 |
-
let apiUrl = `https://
|
2846 |
let res;
|
2847 |
|
2848 |
try {
|
@@ -2919,12 +2915,12 @@ case 'play':
|
|
2919 |
image: {
|
2920 |
url: thumbnail
|
2921 |
},
|
2922 |
-
caption: fontx(`π¬ *Title:* ${title}\
|
2923 |
}, {
|
2924 |
quoted: m
|
2925 |
});
|
2926 |
|
2927 |
-
let apiUrl = `https://
|
2928 |
let res = await fetch(apiUrl);
|
2929 |
let json = await res.json();
|
2930 |
|
@@ -2961,6 +2957,122 @@ case 'play':
|
|
2961 |
});
|
2962 |
}
|
2963 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2964 |
break;
|
2965 |
}
|
2966 |
case 'yts': {
|
@@ -3239,141 +3351,56 @@ case 'scan': {
|
|
3239 |
);
|
3240 |
break;
|
3241 |
}
|
3242 |
-
case '
|
3243 |
-
|
3244 |
-
let gameFile = './database/gameData.json';
|
3245 |
-
let gameData = fs.existsSync(gameFile) ? JSON.parse(fs.readFileSync(gameFile, 'utf8')) : {};
|
3246 |
-
|
3247 |
-
if (typeof gameData !== 'object' || Array.isArray(gameData)) {
|
3248 |
-
gameData = {};
|
3249 |
-
}
|
3250 |
-
|
3251 |
-
if (gameData[user]) {
|
3252 |
-
return conn.sendMessage(m.chat, {
|
3253 |
-
image: { url: "https://huggingface.co/spaces/API-XX/TEST/resolve/main/Links/images.jpeg" },
|
3254 |
-
caption: fontx(`βοΈ *You're already in the game!*\n\nπ° *Balance:* $${gameData[user].money}\nποΈ *Level:* ${gameData[user].level}\nπ‘οΈ *Rank:* ${gameData[user].rank}\nπ *Inventory:* ${gameData[user].inventory.length > 0 ? gameData[user].inventory.join(", ") : "Empty"}\n\nπͺ Visit the *store* to buy powerful weapons! Type *!store* to see available items.`)
|
3255 |
-
});
|
3256 |
-
}
|
3257 |
|
3258 |
-
|
3259 |
-
|
3260 |
-
money: 1000,
|
3261 |
-
level: 1,
|
3262 |
-
xp: 0,
|
3263 |
-
rank: startingRank,
|
3264 |
-
inventory: ["Rusty Dagger βοΈ"],
|
3265 |
-
power: 10 // Hidden Power Level
|
3266 |
-
};
|
3267 |
|
3268 |
try {
|
3269 |
-
|
3270 |
-
|
3271 |
-
console.error("β Error saving game data:", error);
|
3272 |
-
return conn.sendMessage(m.chat, { text: "β An error occurred while saving your game data. Please try again." });
|
3273 |
-
}
|
3274 |
-
|
3275 |
-
conn.sendMessage(m.chat, {
|
3276 |
-
image: { url: "https://huggingface.co/spaces/API-XX/TEST/resolve/main/Links/images.jpeg" },
|
3277 |
-
caption: fontx(`π₯ *Welcome to the Solo Leveling Universe!*\n\nπ° *Starting Balance:* $1000\nποΈ *Level:* 1\nπ‘οΈ *Rank:* ${startingRank}\nβοΈ *Starting Weapon:* Rusty Dagger\n\nβοΈ *Train, fight, and rise to S-Rank!*\n\nπͺ Type *!store* to buy better weapons!`)
|
3278 |
-
});
|
3279 |
-
|
3280 |
-
break;
|
3281 |
-
}
|
3282 |
-
case 'store': {
|
3283 |
-
let storeItems = [
|
3284 |
-
{ name: "Barukaβs Dagger", price: 1200, emoji: "πͺ", power: 50 },
|
3285 |
-
{ name: "Demon Kingβs Longsword", price: 2500, emoji: "π‘οΈ", power: 100 },
|
3286 |
-
{ name: "Kamishβs Wrath", price: 5000, emoji: "π₯", power: 200 },
|
3287 |
-
{ name: "Dagger of the Monarchs", price: 7000, emoji: "π", power: 250 },
|
3288 |
-
{ name: "Elixir of Immortality", price: 3000, emoji: "π§ͺ", power: 0 },
|
3289 |
-
{ name: "Heavenly Fang", price: 8500, emoji: "π©οΈ", power: 300 },
|
3290 |
-
{ name: "Sun Godβs Spear", price: 12_000, emoji: "βοΈ", power: 500 },
|
3291 |
-
{ name: "Celestial Bow", price: 15_000, emoji: "πΉ", power: 600 },
|
3292 |
-
{ name: "Shadow Assassin Daggers", price: 18_000, emoji: "βοΈ", power: 700 },
|
3293 |
-
{ name: "Nightmare Blade", price: 20_000, emoji: "π", power: 800 },
|
3294 |
-
{ name: "Ragnarok Cleaver", price: 25_000, emoji: "π¨", power: 1000 },
|
3295 |
-
{ name: "Infinity Gauntlet", price: 30_000, emoji: "ποΈ", power: 1200 },
|
3296 |
-
{ name: "Hellfire Whip", price: 35_000, emoji: "π₯", power: 1500 },
|
3297 |
-
{ name: "Demonic Reaper Scythe", price: 40_000, emoji: "β οΈ", power: 1800 },
|
3298 |
-
{ name: "Celestial Wrath", price: 50_000, emoji: "β‘", power: 2000 },
|
3299 |
-
{ name: "Dragon Lordβs Katana", price: 65_000, emoji: "π", power: 2500 },
|
3300 |
-
{ name: "Blue Oracle", price: 80_000, emoji: "π·", power: 5000 }
|
3301 |
-
];
|
3302 |
-
|
3303 |
-
let storeMessage = "πͺ *Welcome to the Hunterβs Store!*\n\n";
|
3304 |
-
storeItems.forEach((item, index) => {
|
3305 |
-
storeMessage += `${item.emoji} *${item.name}* - π° $${item.price}\n`;
|
3306 |
-
});
|
3307 |
|
3308 |
-
|
|
|
|
|
3309 |
|
3310 |
-
|
3311 |
-
|
3312 |
-
|
3313 |
-
|
3314 |
|
3315 |
-
|
3316 |
-
|
3317 |
-
|
3318 |
-
let user = m.sender;
|
3319 |
-
let gameFile = './database/gameData.json';
|
3320 |
-
let gameData = fs.existsSync(gameFile) ? JSON.parse(fs.readFileSync(gameFile, 'utf8')) : {};
|
3321 |
-
|
3322 |
-
if (!gameData[user]) return reply("β οΈ You haven't started your journey yet! Type *!startgame* to begin.");
|
3323 |
-
|
3324 |
-
let storeItems = {
|
3325 |
-
"barukaβs dagger": { price: 1200, emoji: "πͺ", power: 50 },
|
3326 |
-
"demon kingβs longsword": { price: 2500, emoji: "π‘οΈ", power: 100 },
|
3327 |
-
"kamishβs wrath": { price: 5000, emoji: "π₯", power: 200 },
|
3328 |
-
"dagger of the monarchs": { price: 7000, emoji: "π", power: 250 },
|
3329 |
-
"elixir of immortality": { price: 3000, emoji: "π§ͺ", power: 0 },
|
3330 |
-
"heavenly fang": { price: 8500, emoji: "π©οΈ", power: 300 },
|
3331 |
-
"sun godβs spear": { price: 12000, emoji: "βοΈ", power: 500 },
|
3332 |
-
"celestial bow": { price: 15000, emoji: "πΉ", power: 600 },
|
3333 |
-
"shadow assassin daggers": { price: 18000, emoji: "βοΈ", power: 700 },
|
3334 |
-
"nightmare blade": { price: 20000, emoji: "π", power: 800 },
|
3335 |
-
"ragnarok cleaver": { price: 25000, emoji: "π¨", power: 1000 },
|
3336 |
-
"infinity gauntlet": { price: 30000, emoji: "ποΈ", power: 1200 },
|
3337 |
-
"hellfire whip": { price: 35000, emoji: "π₯", power: 1500 },
|
3338 |
-
"demonic reaper scythe": { price: 40000, emoji: "β οΈ", power: 1800 },
|
3339 |
-
"celestial wrath": { price: 50000, emoji: "β‘", power: 2000 },
|
3340 |
-
"dragon lordβs katana": { price: 65000, emoji: "π", power: 2500 },
|
3341 |
-
"blue oracle": { price: 80000, emoji: "π·", power: 5000 }
|
3342 |
-
};
|
3343 |
-
|
3344 |
-
let itemName = q.toLowerCase();
|
3345 |
-
if (!storeItems[itemName]) return reply("β οΈ This item is not available in the store!");
|
3346 |
-
|
3347 |
-
let item = storeItems[itemName];
|
3348 |
-
|
3349 |
-
if (gameData[user].money < item.price) {
|
3350 |
-
return reply(`β You don't have enough money! You need π° $${item.price - gameData[user].money} more.`);
|
3351 |
}
|
3352 |
-
|
3353 |
-
gameData[user].money -= item.price;
|
3354 |
-
gameData[user].inventory.push(`${item.emoji} ${itemName}`);
|
3355 |
-
gameData[user].power += item.power;
|
3356 |
-
|
3357 |
-
fs.writeFileSync(gameFile, JSON.stringify(gameData, null, 2));
|
3358 |
-
|
3359 |
-
reply(`β
You successfully purchased *${item.emoji} ${itemName}*!\nπ° Remaining Balance: $${gameData[user].money}`);
|
3360 |
-
|
3361 |
break;
|
3362 |
}
|
3363 |
-
case '
|
3364 |
-
|
3365 |
-
let gameFile = './database/gameData.json';
|
3366 |
-
let gameData = fs.existsSync(gameFile) ? JSON.parse(fs.readFileSync(gameFile, 'utf8')) : {};
|
3367 |
|
3368 |
-
|
|
|
3369 |
|
3370 |
-
|
|
|
|
|
3371 |
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
});
|
3376 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3377 |
break;
|
3378 |
}
|
3379 |
|
@@ -3519,8 +3546,6 @@ case 'rank': {
|
|
3519 |
|
3520 |
|
3521 |
|
3522 |
-
|
3523 |
-
|
3524 |
|
3525 |
|
3526 |
|
|
|
126 |
budy,
|
127 |
content,
|
128 |
body
|
129 |
+
} = dev
|
130 |
const isGroup = m.key.remoteJid.endsWith('@g.us');
|
131 |
const prefixFile = './database/prefix.json';
|
132 |
let prefix = '.';
|
|
|
961 |
> ββββββββββββββ
|
962 |
|
963 |
> βγ \`πππππ πππππππππ\` γ
|
964 |
+
> ${sign} ${prefix}play
|
965 |
+
> ${sign} ${prefix}video
|
966 |
> ${sign} ${prefix}animedl
|
967 |
> ${sign} ${prefix}yts
|
968 |
+
> ${sign} ${prefix}ytmp3
|
969 |
+
> ${sign} ${prefix}ytmp4
|
970 |
+
> ${sign} ${prefix}tiktok
|
971 |
+
> ${sign} ${prefix}tiktokaud
|
|
|
|
|
|
|
|
|
972 |
> ββββββββββββββ
|
973 |
|
974 |
> βγ \`π
πππ πππππππππ\` γ
|
|
|
2838 |
},
|
2839 |
caption: fontx(`πΆ *title:* ${title}\nποΈ *views:* ${views}\nβ±οΈ *duration:* ${timestamp}\nπ
*uploaded:* ${ago}\nπ`) + (` *url:* ${url}\n`) + fontx(`\n> ${caption}`),
|
2840 |
});
|
2841 |
+
let apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp3?url=${encodeURIComponent(url)}`;
|
2842 |
let res;
|
2843 |
|
2844 |
try {
|
|
|
2915 |
image: {
|
2916 |
url: thumbnail
|
2917 |
},
|
2918 |
+
caption: fontx(`π¬ *Title:* ${title}\nfound sending, a sec\n> ${caption}`),
|
2919 |
}, {
|
2920 |
quoted: m
|
2921 |
});
|
2922 |
|
2923 |
+
let apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp4?url=${encodeURIComponent(url)}`;
|
2924 |
let res = await fetch(apiUrl);
|
2925 |
let json = await res.json();
|
2926 |
|
|
|
2957 |
});
|
2958 |
}
|
2959 |
|
2960 |
+
break;
|
2961 |
+
}
|
2962 |
+
case 'ytmp4': {
|
2963 |
+
if (!q) {
|
2964 |
+
return reply(`\`No YouTube link detected\`\n*Example: ${prefix + command} https://youtube.com/watch?v=wKfNaV-su-M*`)
|
2965 |
+
}
|
2966 |
+
|
2967 |
+
await loading();
|
2968 |
+
|
2969 |
+
try {
|
2970 |
+
const response = await fetch(`https://apis.davidcyriltech.my.id/download/ytmp4?url=${encodeURIComponent(q)}`);
|
2971 |
+
const json = await response.json();
|
2972 |
+
|
2973 |
+
if (!json.success || !json.result) {
|
2974 |
+
return conn.sendMessage(m.chat, {
|
2975 |
+
text: "Failed to fetch the video. Ensure the link is valid and try again."
|
2976 |
+
}, {
|
2977 |
+
quoted: m
|
2978 |
+
});
|
2979 |
+
}
|
2980 |
+
|
2981 |
+
const {
|
2982 |
+
quality,
|
2983 |
+
title,
|
2984 |
+
thumbnail,
|
2985 |
+
download_url
|
2986 |
+
} = json.result;
|
2987 |
+
|
2988 |
+
const captionText = fontx(`video found sending, a sec`);
|
2989 |
+
|
2990 |
+
await conn.sendMessage(m.chat, {
|
2991 |
+
image: {
|
2992 |
+
url: thumbnail
|
2993 |
+
},
|
2994 |
+
caption: captionText
|
2995 |
+
}, {
|
2996 |
+
quoted: m
|
2997 |
+
});
|
2998 |
+
|
2999 |
+
await conn.sendMessage(m.chat, {
|
3000 |
+
video: {
|
3001 |
+
url: download_url
|
3002 |
+
},
|
3003 |
+
caption: fontx(`π¬ *${title}*\nπΉ Quality: ${quality}`),
|
3004 |
+
mimetype: 'video/mp4'
|
3005 |
+
}, {
|
3006 |
+
quoted: m
|
3007 |
+
});
|
3008 |
+
|
3009 |
+
} catch (error) {
|
3010 |
+
console.error("Error in ytmp4 case:", error);
|
3011 |
+
conn.sendMessage(m.chat, {
|
3012 |
+
text: "An error occurred while processing your request. Please try again later."
|
3013 |
+
}, {
|
3014 |
+
quoted: m
|
3015 |
+
});
|
3016 |
+
}
|
3017 |
+
|
3018 |
+
break;
|
3019 |
+
}
|
3020 |
+
case 'ytmp3': {
|
3021 |
+
if (!q) {
|
3022 |
+
return reply(`\`No YouTube link detected\`\n*Example: ${prefix + command} https://youtube.com/watch?v=wKfNaV-su-M*`)
|
3023 |
+
}
|
3024 |
+
|
3025 |
+
await loading();
|
3026 |
+
|
3027 |
+
try {
|
3028 |
+
const response = await fetch(`https://apis.davidcyriltech.my.id/download/ytmp3?url=${encodeURIComponent(q)}`);
|
3029 |
+
const json = await response.json();
|
3030 |
+
|
3031 |
+
if (!json.success || !json.result) {
|
3032 |
+
return conn.sendMessage(m.chat, {
|
3033 |
+
text: "Failed to fetch the audio. Ensure the link is valid and try again."
|
3034 |
+
}, {
|
3035 |
+
quoted: m
|
3036 |
+
});
|
3037 |
+
}
|
3038 |
+
|
3039 |
+
const {
|
3040 |
+
quality,
|
3041 |
+
title,
|
3042 |
+
thumbnail,
|
3043 |
+
download_url
|
3044 |
+
} = json.result;
|
3045 |
+
|
3046 |
+
const captionText = fontx(`audio found sending, a sec`);
|
3047 |
+
|
3048 |
+
await conn.sendMessage(m.chat, {
|
3049 |
+
image: {
|
3050 |
+
url: thumbnail
|
3051 |
+
},
|
3052 |
+
caption: captionText
|
3053 |
+
}, {
|
3054 |
+
quoted: m
|
3055 |
+
});
|
3056 |
+
|
3057 |
+
await conn.sendMessage(m.chat, {
|
3058 |
+
audio: {
|
3059 |
+
url: download_url
|
3060 |
+
},
|
3061 |
+
mimetype: 'audio/mpeg',
|
3062 |
+
fileName: `${title}.mp3`
|
3063 |
+
}, {
|
3064 |
+
quoted: m
|
3065 |
+
});
|
3066 |
+
|
3067 |
+
} catch (error) {
|
3068 |
+
console.error("Error in ytmp3 case:", error);
|
3069 |
+
conn.sendMessage(m.chat, {
|
3070 |
+
text: "An error occurred while processing your request. Please try again later."
|
3071 |
+
}, {
|
3072 |
+
quoted: m
|
3073 |
+
});
|
3074 |
+
}
|
3075 |
+
|
3076 |
break;
|
3077 |
}
|
3078 |
case 'yts': {
|
|
|
3351 |
);
|
3352 |
break;
|
3353 |
}
|
3354 |
+
case 'tiktok': {
|
3355 |
+
if (!q) return reply("β Please provide a TikTok link.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3356 |
|
3357 |
+
await loading();
|
3358 |
+
let apiUrl = `https://api-xx-xi.hf.space/api/tkdl?url=${encodeURIComponent(q)}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3359 |
|
3360 |
try {
|
3361 |
+
let response = await fetch(apiUrl);
|
3362 |
+
let json = await response.json();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3363 |
|
3364 |
+
if (!json.success || !json.download_links.no_watermark) {
|
3365 |
+
return reply("β Failed to download the TikTok video. Please check the link and try again.");
|
3366 |
+
}
|
3367 |
|
3368 |
+
await conn.sendMessage(m.chat, {
|
3369 |
+
video: { url: json.download_links.no_watermark },
|
3370 |
+
caption: fontx(`π΅ *TikTok Video Downloaded!*\n\nπ *Description:* ${json.description}\n> ${caption}`)
|
3371 |
+
}, { quoted: m });
|
3372 |
|
3373 |
+
} catch (error) {
|
3374 |
+
console.error("Error in TikTok download case:", error);
|
3375 |
+
reply("β An error occurred while processing your request.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3376 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3377 |
break;
|
3378 |
}
|
3379 |
+
case 'tiktokaud': {
|
3380 |
+
if (!q) return reply("β Please provide a TikTok link.");
|
|
|
|
|
3381 |
|
3382 |
+
await loading();
|
3383 |
+
let apiUrl = `https://api-xx-xi.hf.space/api/tkdl?url=${encodeURIComponent(q)}`;
|
3384 |
|
3385 |
+
try {
|
3386 |
+
let response = await fetch(apiUrl);
|
3387 |
+
let json = await response.json();
|
3388 |
|
3389 |
+
if (!json.success || !json.download_links.mp3) {
|
3390 |
+
return reply("β Failed to download the TikTok audio. Please check the link and try again.");
|
3391 |
+
}
|
|
|
3392 |
|
3393 |
+
await conn.sendMessage(m.chat, {
|
3394 |
+
audio: { url: json.download_links.mp3 },
|
3395 |
+
mimetype: 'audio/mpeg',
|
3396 |
+
fileName: `tiktok_audio.mp3`,
|
3397 |
+
caption: fontx(`πΆ *TikTok Audio Downloaded!*\n\nπ *Description:* ${json.description}\n> ${caption}`)
|
3398 |
+
}, { quoted: m });
|
3399 |
+
|
3400 |
+
} catch (error) {
|
3401 |
+
console.error("Error in TikTok audio download case:", error);
|
3402 |
+
reply("β An error occurred while processing your request.");
|
3403 |
+
}
|
3404 |
break;
|
3405 |
}
|
3406 |
|
|
|
3546 |
|
3547 |
|
3548 |
|
|
|
|
|
3549 |
|
3550 |
|
3551 |
|