From e43436d4cf9d4686e6ca83f0b30dd4af3443fd49 Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 5 Nov 2021 09:38:32 +0000 Subject: [PATCH] fix for new image url --- .gitignore | 4 +++- bot.js | 13 +++++-------- package-lock.json | 29 +---------------------------- package.json | 3 +-- 4 files changed, 10 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index a55e10b..5fbc5e1 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,6 @@ dist # End of https://www.toptal.com/developers/gitignore/api/node -config.json \ No newline at end of file +config.json + +test \ No newline at end of file diff --git a/bot.js b/bot.js index d38704d..60e6c0f 100644 --- a/bot.js +++ b/bot.js @@ -3,18 +3,16 @@ const axios = require("axios").default; const moment = require("moment"); -const TurndownService = require("turndown"); const config = require("./config.json"); async function main() { - let turndownService = new TurndownService(); // let data = (await axios("https://vps.anotherfoxguy.com/dl/fur-events.json")).data; let data = (await axios("https://api.fynn.ai/events")).data; let min = moment().add(1, "minutes"); // minutes - let max = moment().add(31, "minutes"); - //let max = moment().add(1.5, "days"); + let max = moment().add(61, "minutes"); + // let max = moment().add(8, "hours"); //console.log(dat.data) @@ -44,7 +42,7 @@ async function main() { let embed = { title: event.name, //`${event.name} will start in `,// - description: turndownService.turndown(event.description), + description: event.description.replace(/\\n/gm, "\n"), timestamp: moment.unix(event.start), url: `https://furality.org/schedule#${event.id}`, color: colour, @@ -63,8 +61,8 @@ async function main() { }; if (event.image_url != "missing") { - embed.thumbnail = { - url: `https://furality.org/${event.image_url}`, + embed.image = { + url: event.image_url, }; } @@ -72,7 +70,6 @@ async function main() { }); if (evembeds.length > 0) { - axios .post(config.webhookurl, { embeds: evembeds, diff --git a/package-lock.json b/package-lock.json index 0b335be..c604249 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,8 +6,7 @@ "": { "dependencies": { "axios": "^0.24.0", - "moment": "^2.29.1", - "turndown": "^7.1.1" + "moment": "^2.29.1" } }, "node_modules/axios": { @@ -18,11 +17,6 @@ "follow-redirects": "^1.14.4" } }, - "node_modules/domino": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.6.tgz", - "integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==" - }, "node_modules/follow-redirects": { "version": "1.14.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz", @@ -49,14 +43,6 @@ "engines": { "node": "*" } - }, - "node_modules/turndown": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/turndown/-/turndown-7.1.1.tgz", - "integrity": "sha512-BEkXaWH7Wh7e9bd2QumhfAXk5g34+6QUmmWx+0q6ThaVOLuLUqsnkq35HQ5SBHSaxjSfSM7US5o4lhJNH7B9MA==", - "dependencies": { - "domino": "^2.1.6" - } } }, "dependencies": { @@ -68,11 +54,6 @@ "follow-redirects": "^1.14.4" } }, - "domino": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.6.tgz", - "integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==" - }, "follow-redirects": { "version": "1.14.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz", @@ -82,14 +63,6 @@ "version": "2.29.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" - }, - "turndown": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/turndown/-/turndown-7.1.1.tgz", - "integrity": "sha512-BEkXaWH7Wh7e9bd2QumhfAXk5g34+6QUmmWx+0q6ThaVOLuLUqsnkq35HQ5SBHSaxjSfSM7US5o4lhJNH7B9MA==", - "requires": { - "domino": "^2.1.6" - } } } } diff --git a/package.json b/package.json index 2f81e92..44af895 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "dependencies": { "axios": "^0.24.0", - "moment": "^2.29.1", - "turndown": "^7.1.1" + "moment": "^2.29.1" } }