-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zodiak.js
26 lines (23 loc) · 981 Bytes
/
zodiak.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* eslint-disable no-console */
const axios = require('axios').default;
const getZodiak = (nama, tgl) =>
// eslint-disable-next-line implicit-arrow-linebreak
new Promise((resolve, reject) => {
// console.log(`${nama} - ${tgl}`);
axios
.get(`https://script.google.com/macros/exec?service=AKfycbw7gKzP-WYV2F5mc9RaR7yE3Ve1yN91Tjs91hp_jHSE02dSv9w&nama=${nama}&tanggal=${tgl}`)
.then((response) => {
// console.log(response.data);
// eslint-disable-next-line object-curly-newline
const { lahir, usia, ultah, zodiak } = response.data.data;
let text = `*Nama*: ${nama}\n`;
text += `*Lahir*: ${lahir}\n`;
text += `*Usia*: ${usia}\n`;
text += `*Ultah*: ${ultah}\n`;
text += `*Zodiak*: ${zodiak}`;
text += `*Ini cuma hiburan, jangan terlalu percaya*`;
resolve(text);
})
.catch((error) => reject(error));
});
module.exports.getZodiak = getZodiak;