Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const schedule = require('node-schedule');
- const cheerio = require('cheerio');
- const request = require('request');
- function misje() {
- request('https://www.stormshield.one/a/6qjnjn', (error, response, html) => {
- if (!error && response.statusCode == 200) {
- const channel = bot.channels.find(channel => channel.id == '617308571905818634');
- const $ = cheerio.load(html);
- let xd = $('.datagrid-row').toArray();
- console.log(xd.length);
- if (xd.length == 0) {
- const channelerr = bot.channels.find(channel => channel.id == '619611614429315103');
- chanelerr.send('Nie udało się uzyskać misji z Epickim Profitem(możliwe, że aktualnie nie ma żadnych dostępnych)')
- return;
- }
- //let moc = xd[1].children[1].children;
- console.log(xd[0].children[1].children[1].data); //pokazuje moc misji
- console.log(xd[0].children[3].children[0].children[0].data); //pokazuje nazwę misji(np. wystrzel rakiete/naprawa schronu itp)
- console.log(xd[0].children[3].children[3].data) //pokazuje gdzie znajduję się misja (`dolina/twine i przedmieścia, miasto itp)
- let text;
- // for (text of moc) {
- // message.author.send('Misja ' + text + 'mocy');
- // }
- channel.send('<@&617331932786720768>' + ' Dostępnych jest: ' + xd.length + ' misji na epicki profit:')
- for (let i = 0; i < xd.length; i++) {
- // console.log(xd[i].children[1].children[1].data + xd[i].children[3].children[0].children[0].data + xd[i].children[3].children[3].data);
- // message.author.send('Misja: ⚡' + xd[i].children[1].children[1].data + ' mocy ' + xd[i].children[3].children[0].children[0].data + ' ' + xd[i].children[3].children[3].data)
- let misja = new Discord.RichEmbed()
- .setColor('9a3ed0')
- .setAuthor('Misja na Epicki Profit+!', 'https://cdn.discordapp.com/attachments/617294529027899422/617469395576422526/Perk-up_epic_icon.png')
- misja.setDescription('**' + xd[i].children[3].children[3].data + '**' + ' \n**PERK-UP! (Epic)**\n' + (xd[1].children[3].children[0].children[0].data) + ' - ' + '``' + xd[i].children[1].children[1].data + '⚡' + '``')
- channel.send(misja)
- }
- } else {
- const channel = bot.channels.find(channel => channel.id == '619611614429315103');
- channel.send('Połączenie nieudane. Spróbuj ponownie. Kod błędu: ' + error);
- };
- })
- request('https://www.stormshield.one/a/9y7zz8', (error, response, html) => {
- if (!error && response.statusCode == 200) {
- let channel = bot.channels.find(channel => channel.id == '617308571905818634');
- const $ = cheerio.load(html);
- let xd = $('.datagrid-row').toArray();
- console.log(xd.length);
- if (xd.length == 0) {
- const channelerr = bot.channels.find(channel => channel.id == '619611614429315103');
- channelerr.send('Nie udało się uzyskać misji z vDolcami(możliwe, że aktualnie nie ma żadnych dostępnych) ')
- return;
- }
- //let moc = xd[1].children[1].children;
- console.log(xd[0].children[1].children[1].data); //pokazuje moc misji
- console.log(xd[0].children[3].children[0].children[0].data); //pokazuje nazwę misji(np. wystrzel rakiete/naprawa schronu itp)
- console.log(xd[0].children[3].children[3].data) //pokazuje gdzie znajduję się misja (`dolina/twine i przedmieścia, miasto itp)
- let text;
- channel = bot.channels.find(channel => channel.id == '617308571905818634');
- channel.send('<@&617331932786720768>' + ' Dostępnych jest: ' + xd.length + ' misji na vDolce:')
- for (let i = 0; i < xd.length; i++) {
- let misja = new Discord.RichEmbed()
- .setColor('D46618')
- .setAuthor('Misja na vDolce!', 'https://image.fnbr.co/misc/5ab28272ca60ff5b5d8a3e72/icon.png')
- misja.setDescription('**' + xd[i].children[3].children[3].data + '**' + ' \n**vDolce**\n' + (xd[i].children[3].children[0].children[0].data) + ' - ' + '``' + xd[i].children[1].children[1].data + '⚡' + '``')
- channel.send(misja)
- }
- } else {
- const channel = bot.channels.find(channel => channel.id == '619611614429315103');
- channel.send('Połączenie nieudane. Spróbuj ponownie. Kod błędu: ' + error);
- };
- })
- request('https://www.stormshield.one/a/9vfaxs', (error, response, html) => {
- if (!error && response.statusCode == 200) {
- const channel = bot.channels.find(channel => channel.id == '617308571905818634');
- const $ = cheerio.load(html);
- let xd = $('.datagrid-row').toArray();
- console.log(xd.length);
- if (xd.length == 0) {
- const channelerr = bot.channels.find(channel => channel.id == '619611614429315103');
- chanelerr.send('Nie udało się uzyskać misji z Legendarnym Profitem(możliwe, że aktualnie nie ma żadnych dostępnych) ')
- return;
- }
- //let moc = xd[1].children[1].children;
- console.log(xd[1].children[1].children[1].data); //pokazuje moc misji
- console.log(xd[1].children[3].children[0].children[0].data); //pokazuje nazwę misji(np. wystrzel rakiete/naprawa schronu itp)
- console.log(xd[1].children[3].children[3].data) //pokazuje gdzie znajduję się misja (`dolina/twine i przedmieścia, miasto itp)
- let text;
- channel.send('<@&617331932786720768>' + ' Dostępnych jest: ' + xd.length + ' misji na Legendarny Profit:')
- for (let i = 0; i < xd.length; i++) {
- let misja = new Discord.RichEmbed()
- .setColor('D46618')
- .setAuthor('Misja na Legendarny Profit!', 'https://gamepedia.cursecdn.com/fortnite_gamepedia/5/5b/Perk-up_legendary_icon.png')
- misja.setDescription('**' + xd[i].children[3].children[3].data + '**' + ' \n**Legendarny Profit**\n' + (xd[1].children[3].children[0].children[0].data) + ' - ' + '``' + xd[i].children[1].children[1].data + '⚡' + '``')
- channel.send(misja)
- }
- } else {
- const channel = bot.channels.find(channel => channel.id == '619611614429315103');
- channel.send('Połączenie nieudane. Spróbuj ponownie. Kod błędu: ' + error);
- };
- })
- }
- var j = schedule.scheduleJob('00 12 * * *', misje);
- var j = schedule.scheduleJob('00 00 * * *', misje);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement