UNPKG

roicmedya-api

Version:

RoicMedya.com SMM Modülü ile Instagram ve diğer platformlar için takipçi ve beğeni entegrasyonlarını zahmetsizce yapın.

21 lines (15 loc) 637 B
const axios = require('axios'); async function serviceControl(apiKey, baseURL, serviceId) { try { const response = await axios.get(`${baseURL}?key=${apiKey}&action=services`); const services = Array.isArray(response.data) ? response.data : response.data.services; const service = services.find(s => String(s.service) === String(serviceId)); if (!service) { throw new Error('Belirtilen servis bulunamadı'); } return service; } catch (error) { throw new Error(`Servis alınamadı: ${error.response?.data?.error || error.message}`); } } module.exports = { serviceControl };