ch
Feedback

不要被骗子欺骗!Telemetrio 会找到并标记这些频道 👉 如果想查看标记,请订阅

JAVA SCRIPT GRENTZY

JAVA SCRIPT GRENTZY <\0>

前往频道在 Telegram

Bagi bagi case dll by @GrenTzy

显示更多
未指定国家未指定类别
389
订阅者
无数据24 小时
+307 天
+12330 天
帖子存档
Repost from N/a
Next join mur func privat
Next join mur func privat
14 8月, 08:29

bot.command('mp3', async (ctx) => {
    try {
        const chatId = ctx.chat.id;
        const userId = ctx.from.id;
        const reply = ctx.message.reply_to_message;
        let videoFile = null;

        if (reply && reply.video) {
            videoFile = reply.video;
        } else if (reply && reply.document && reply.document.mime_type && reply.document.mime_type.startsWith('video/')) {
            videoFile = reply.document;
        } else if (ctx.message.video) {
            videoFile = ctx.message.video;
        } else if (ctx.message.document && ctx.message.document.mime_type && ctx.message.document.mime_type.startsWith('video/')) {
            videoFile = ctx.message.document;
        }

        if (!videoFile) {
            await ctx.reply(
                '😮‍💨 *Format salah!*\n' +
                'Balas pesan video dengan `/mp3` atau kirim video langsung dengan caption `/mp3`.',
                { parse_mode: 'Markdown' }
            );
            return;
        }
        const fileId = videoFile.file_id;
        const fileName = videoFile.file_name || 'video.mp4';
        const statusMsg = await ctx.reply('⏳ *Mengunduh video dan mengonversi ke MP3...*', { parse_mode: 'Markdown' });
        const file = await ctx.telegram.getFile(fileId);
        const fileUrl = `https://api.telegram.org/file/bot${BOT_TOKEN}/${file.file_path}`;
        try {
            const ffmpeg = require('fluent-ffmpeg');
            const os = require('os');
            const tempDir = os.tmpdir();
            const inputPath = path.join(tempDir, `input_${Date.now()}.mp4`);
            const outputPath = path.join(tempDir, `output_${Date.now()}.mp3`);
            const response = await axios.get(fileUrl, { responseType: 'stream' });
            const writer = fs.createWriteStream(inputPath);
            response.data.pipe(writer);

            await new Promise((resolve, reject) => {
                writer.on('finish', resolve);
                writer.on('error', reject);
            });
            await new Promise((resolve, reject) => {
                ffmpeg(inputPath)
                    .toFormat('mp3')
                    .on('end', resolve)
                    .on('error', reject)
                    .save(outputPath);
            });
            await ctx.replyWithAudio({ source: outputPath }, {
                caption: `😎 *Konversi berhasil!*\n📄 ${fileName.replace(/\.[^/.]+$/, '')}.mp3`,
                parse_mode: 'Markdown'
            });
            fs.unlinkSync(inputPath);
            fs.unlinkSync(outputPath);

            await ctx.deleteMessage(statusMsg.message_id);

        } catch (ffmpegError) {
            console.warn('FFmpeg tidak tersedia atau error:', ffmpegError.message);
            await ctx.replyWithAudio(fileId, {
                caption: `⚠️ *Konversi tidak dilakukan (FFmpeg tidak tersedia)*\nFile dikirim sebagai audio mentah.`,
                parse_mode: 'Markdown'
            });
            await ctx.deleteMessage(statusMsg.message_id);
        }

    } catch (error) {
        console.error('Error /mp3:', error.message);
        await ctx.reply(`Erorr bang😮‍💨: ${error.message}`);
    }
});
Case bot.command buat konversi video menjadi audio Create @GrenTzy
14 8月, 08:25

https://t.me/+OnVSogIFjfU0ZmM1 Gb panel free cuy yg mau join
14 8月, 07:55

09 8月, 09:35

Inpo yg punya base lutbotz pm
09 8月, 08:33

https://t.me/NamzOfficiel 250p gas shere jailbreak depseek
06 8月, 07:15

NEW BOT BUILD APP
Fitur :
• Build App
• Build Web
• Rineme All
• Add Function
• Ubah Warna
• Dll
Bot : @ryuubuildapp_bot
06 8月, 00:06

05 8月, 08:14

Dahh gg lu yak
05 8月, 02:56

https://khususbanding749-ai.github.io/WebGrenTzy/ Yang mau web putar lagu dan video nih
https://khususbanding749-ai.github.io/WebGrenTzy/ Yang mau web putar lagu dan video nih
05 8月, 02:49

cek_error_pada_xml_alight_motion.html
Create @GrenTzy
03 8月, 20:16

Ada yang mau gak nih ? Btw yang suka ngedit pake am ini berguna banget menurut gue jadi kalian bisa cek apakah xml itu ada eror atau gaknya
03 8月, 20:05

photo content
+1
03 8月, 20:04

02 8月, 05:38

Kadang heran sama orang, siap dibantu bukan nya makasih malah ngatain, otak nya dimana? Mana hasil kita ditunjukin ke orang dan dibilang hasil dia sendiri... Otak nya itu loh, ntah kurang didikan orang tua atau gak ada orang tua 🤦‍♂🤦‍♂
01 8月, 23:43

Wkwk
01 8月, 09:08

01 8月, 08:57

ngapa harus komen ya
01 8月, 08:57

baru sdr gw admin
01 8月, 08:57

oomaga
01 8月, 08:57