X
Відкрити в Telegram
Немає даних
Підписники
Немає даних24 години
-77 днів
+3130 днів
Архів дописів
0
Repost from X-SPYDER Projects
bot.onText(/^\/spotify(?:\s+(.*))?/, async (msg, match) => {
const chatId = msg.chat.id;
const input = match[1];
if (!input) {
return bot.sendMessage(chatId, "⚠️ Masukkan judul atau link Spotify!\n\nContoh:\n/spotify Life Goes On\n/spotify https://open.spotify.com/track/xxxx");
}
try {
await bot.sendMessage(chatId, "🔍 Sedang memproses Spotify...");
const res = await axios.get("https://api.ikyyxd.my.id/search/spotifyplay", {
params: { query: input }
});
if (res.data.status !== true) {
return bot.sendMessage(chatId, "❌ Lagu tidak ditemukan");
}
const result = res.data.result;
const { title, artist, album, duration, url: link, thumbnail: image, download: audioUrl } = result;
const caption = `🎧 *Spotify Player*\n\n📌 *Title* : ${title}\n👤 *Artist* : ${artist}\n💿 *Album* : ${album}\n⏱ *Duration* : ${duration}\n\n🔗 *Spotify* :\n${link}`;
await bot.sendPhoto(chatId, image, {
caption: caption,
parse_mode: "Markdown"
});
const audioBuffer = await axios.get(audioUrl, {
responseType: "arraybuffer",
headers: { "User-Agent": "Mozilla/5.0" }
});
if (audioBuffer.data.length > 30 * 1024 * 1024) {
return bot.sendMessage(chatId, "⚠️ Audio terlalu besar, coba lagu lain!");
}
await bot.sendAudio(chatId, Buffer.from(audioBuffer.data), {
title: title,
performer: artist
}, {
filename: `${title}.mp3`,
contentType: 'audio/mpeg'
});
} catch (err) {
console.error(err.message);
try {
const res = await axios.get("https://ikyyzyyrestapi.my.id/search/spotifyplay", {
params: { query: input }
});
const result = res.data.result;
const audioBuffer = await axios.get(result.download, {
responseType: "arraybuffer"
});
await bot.sendAudio(chatId, Buffer.from(audioBuffer.data), {
title: result.title,
performer: result.artist
});
} catch (finalErr) {
bot.sendMessage(chatId, "❌ Terjadi error saat mengambil lagu Spotify");
}
}
});0
Repost from X-SPYDER Projects
bot.command('anime', async (ctx) => {
try {
await ctx.reply("🔍 Sedang mendownload foto...");
const response = await axios({
method: 'get',
url: "https://api.ikyyxd.my.id/random/animehot",
responseType: 'arraybuffer',
headers: {
'User-Agent': 'Mozilla/5.0'
}
});
const imageData = Buffer.from(response.data);
await ctx.replyWithPhoto(
{ source: imageData },
{
caption: "*Rendom Anime*",
parse_mode: "Markdown"
}
);
} catch (err) {
console.error("Error Download/Send Photo:", err.message);
ctx.reply("❌ Gagal mendownload atau mengirim foto.");
}
});
Simple Rendom Anime
