User: gabungkan kedua kode ini exports.run = {
usage: ['tiktok'],
hidden: ['tt'],
use: 'link tiktok',
category: 'downloader',
async: async (m, { func, mecha, isPrem }) => {
if (!m.text) return m.reply(func.example(m.cmd, 'https://vt.tiktok.com/ZSF4cWcA2/'))
if (!m.args[0].includes('tiktok.com')) return m.reply(global.mess.error.url)
mecha.sendReact(m.chat, '🕒', m.key)
await func.tiktok(m.args[0]).then(res => {
if (res.status == 400) return m.reply(mess.error.api)
if (res.result.audio == undefined) return m.reply('itu tiktokslide tolol.')
let txt = '乂  *TIKTOK - DOWNLOADER*\n'
txt += `\n◦  *Title* : ${res.result.caption}`
txt += `\n◦  *Quality* : MEDIUM`
mecha.sendMessage(m.chat, {video: {url: res.result.medium}, caption: txt}, {quoted: m, ephemeralExpiration: m.expiration})
}).catch((err) => m.reply('Maaf terjadi kesalahan.'))
},
limit: 5
} dan exports.run = {
usage: ['tiktokslide'],
hidden: ['ttslide'],
use: 'link tiktok',
category: 'downloader',
async: async (m, { func, mecha, errorMessage }) => {
if (!m.text) return m.reply(func.example(m.cmd, 'https://www.tiktok.com/t/ZTNkBtxpp/'));
if (!m.args[0].includes('tiktok.com')) return m.reply(global.mess.error.url);
mecha.sendReact(m.chat, '💬', m.key);
try {
let res = await func.fetchJson(`https://skizo.tech/api/tiktok?apikey=syauqi27&url=${m.args[0]}`);
if (res.code !== 0) return m.reply(global.mess.error.api);
if (!res.data) return m.reply('Image not found.');
if (res.data.images.length === 0) return m.reply('Image not found.');
let data = res.data;
let txt = `*T I K T O K - S L I D E*\n`;
txt += `\n- Title: ${data.title ?? 'Not Known'}`;
txt += `\n- Total Images: ${data.images.length}`;
txt += `\n\n_Please wait, the images are being sent..._`;
await mecha.sendMessage(m.chat, { text: txt }, { quoted: m, ephemeralExpiration: m.expiration }).then(async () => {
await mecha.sendMessage(m.chat, {
audio: {
url: data.music
},
mimetype: 'audio/mpeg',
ptt: false
}, {quoted: m, ephemeralExpiration: m.expiration});
// Send each image separately
for (let url of data.images) {
await mecha.sendMessage(m.chat, {
image: {
url: url
}
}, {quoted: m, ephemeralExpiration: m.expiration});
}
});
} catch (e) {
m.reply(global.mess.error.api);
return errorMessage(e);
}
},
limit: 5
};
User: gabungkan kedua kode ini exports.run = {
usage: ['tiktok'],
hidden: ['tt'],
use: 'link tiktok',
category: 'downloader',
async: async (m, { func, mecha, isPrem }) => {
if (!m.text) return m.reply(func.example(m.cmd, 'https://vt.tiktok.com/ZSF4cWcA2/'))
if (!m.args[0].includes('tiktok.com')) return m.reply(global.mess.error.url)
mecha.sendReact(m.chat, '🕒', m.key)
await func.tiktok(m.args[0]).then(res => {
if (res.status == 400) return m.reply(mess.error.api)
if (res.result.audio == undefined) return m.reply('itu tiktokslide tolol.')
let txt = '乂  *TIKTOK - DOWNLOADER*\n'
txt += `\n◦  *Title* : ${res.result.caption}`
txt += `\n◦  *Quality* : MEDIUM`
mecha.sendMessage(m.chat, {video: {url: res.result.medium}, caption: txt}, {quoted: m, ephemeralExpiration: m.expiration})
}).catch((err) => m.reply('Maaf terjadi kesalahan.'))
},
limit: 5
} dan exports.run = {
usage: ['tiktokslide'],
hidden: ['ttslide'],
use: 'link tiktok',
category: 'downloader',
async: async (m, { func, mecha, errorMessage }) => {
if (!m.text) return m.reply(func.example(m.cmd, 'https://www.tiktok.com/t/ZTNkBtxpp/'));
if (!m.args[0].includes('tiktok.com')) return m.reply(global.mess.error.url);
mecha.sendReact(m.chat, '💬', m.key);
try {
let res = await func.fetchJson(`https://skizo.tech/api/tiktok?apikey=syauqi27&url=${m.args[0]}`);
if (res.code !== 0) return m.reply(global.mess.error.api);
if (!res.data) return m.reply('Image not found.');
if (res.data.images.length === 0) return m.reply('Image not found.');
let data = res.data;
let txt = `*T I K T O K - S L I D E*\n`;
txt += `\n- Title: ${data.title ?? 'Not Known'}`;
txt += `\n- Total Images: ${data.images.length}`;
txt += `\n\n_Please wait, the images are being sent..._`;
await mecha.sendMessage(m.chat, { text: txt }, { quoted: m, ephemeralExpiration: m.expiration }).then(async () => {
await mecha.sendMessage(m.chat, {
audio: {
url: data.music
},
mimetype: 'audio/mpeg',
ptt: false
}, {quoted: m, ephemeralExpiration: m.expiration});
// Send each image separately
for (let url of data.images) {
await mecha.sendMessage(m.chat, {
image: {
url: url
}
}, {quoted: m, ephemeralExpiration: m.expiration});
}
});
} catch (e) {
m.reply(global.mess.error.api);
return errorMessage(e);
}
},
limit: 5
};
Assistant: