API-XX commited on
Commit
ee7527e
Β·
verified Β·
1 Parent(s): 6b4ef00

Upload case.js

Browse files
Files changed (1) hide show
  1. case.js +14 -11
case.js CHANGED
@@ -3989,7 +3989,7 @@ case 'mediafire': {
3989
  break;
3990
  case 'vv': {
3991
  if (!m.quoted) {
3992
- return reply(`*Reply to an image or video with the caption ${prefix + command}*\n> Video Duration: 1-9 Seconds`);
3993
  }
3994
 
3995
  let mime = (m.quoted.msg || m.quoted).mimetype || '';
@@ -3999,27 +3999,30 @@ case 'mediafire': {
3999
  let media = await m.quoted.download();
4000
  await conn.sendMessage(m.chat, {
4001
  image: media,
4002
- caption: fontx('πŸ“Έ *View Once Image*'),
4003
- viewOnce: true
4004
  }, { quoted: m });
4005
 
4006
  } else if (/video/.test(mime)) {
4007
- if ((m.quoted.msg || m.quoted).seconds > 9) {
4008
- return reply(`*Video duration must be 1-9 seconds!*\nReply to a shorter video with ${prefix + command}`);
4009
- }
4010
  let media = await m.quoted.download();
4011
  await conn.sendMessage(m.chat, {
4012
  video: media,
4013
- caption: fontx('πŸŽ₯ *View Once Video*'),
4014
- viewOnce: true
 
 
 
 
 
 
 
4015
  }, { quoted: m });
4016
 
4017
  } else {
4018
- reply(`*Unsupported media type!*\nReply to an image or video with the caption ${prefix + command}\n> Video Duration: 1-9 Seconds`);
4019
  }
4020
  } catch (err) {
4021
- console.error('Error sending View Once media:', err);
4022
- reply(`❌ Failed to send View Once media. Please try again.`);
4023
  }
4024
 
4025
  break;
 
3989
  break;
3990
  case 'vv': {
3991
  if (!m.quoted) {
3992
+ return reply(`*Reply to an image, video, or audio with the caption ${prefix + command}*`);
3993
  }
3994
 
3995
  let mime = (m.quoted.msg || m.quoted).mimetype || '';
 
3999
  let media = await m.quoted.download();
4000
  await conn.sendMessage(m.chat, {
4001
  image: media,
4002
+ caption: fontx('πŸ“Έ *Here is your image!*')
 
4003
  }, { quoted: m });
4004
 
4005
  } else if (/video/.test(mime)) {
 
 
 
4006
  let media = await m.quoted.download();
4007
  await conn.sendMessage(m.chat, {
4008
  video: media,
4009
+ caption: fontx('πŸŽ₯ *Here is your video!*')
4010
+ }, { quoted: m });
4011
+
4012
+ } else if (/audio/.test(mime)) {
4013
+ let media = await m.quoted.download();
4014
+ await conn.sendMessage(m.chat, {
4015
+ audio: media,
4016
+ mimetype: 'audio/mpeg',
4017
+ ptt: false // Set to true if you want to send as a voice note
4018
  }, { quoted: m });
4019
 
4020
  } else {
4021
+ reply(`❌ Unsupported media type!\nReply to an image, video, or audio with *${prefix + command}*`);
4022
  }
4023
  } catch (err) {
4024
+ console.error('Error processing media:', err);
4025
+ reply(`❌ Failed to process media. Please try again.`);
4026
  }
4027
 
4028
  break;