fix for new image url
This commit is contained in:
parent
396a21741d
commit
e43436d4cf
4
.gitignore
vendored
4
.gitignore
vendored
@ -135,4 +135,6 @@ dist
|
|||||||
# End of https://www.toptal.com/developers/gitignore/api/node
|
# End of https://www.toptal.com/developers/gitignore/api/node
|
||||||
|
|
||||||
|
|
||||||
config.json
|
config.json
|
||||||
|
|
||||||
|
test
|
13
bot.js
13
bot.js
@ -3,18 +3,16 @@
|
|||||||
|
|
||||||
const axios = require("axios").default;
|
const axios = require("axios").default;
|
||||||
const moment = require("moment");
|
const moment = require("moment");
|
||||||
const TurndownService = require("turndown");
|
|
||||||
|
|
||||||
const config = require("./config.json");
|
const config = require("./config.json");
|
||||||
|
|
||||||
async function main() {
|
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://vps.anotherfoxguy.com/dl/fur-events.json")).data;
|
||||||
let data = (await axios("https://api.fynn.ai/events")).data;
|
let data = (await axios("https://api.fynn.ai/events")).data;
|
||||||
|
|
||||||
let min = moment().add(1, "minutes"); // minutes
|
let min = moment().add(1, "minutes"); // minutes
|
||||||
let max = moment().add(31, "minutes");
|
let max = moment().add(61, "minutes");
|
||||||
//let max = moment().add(1.5, "days");
|
// let max = moment().add(8, "hours");
|
||||||
|
|
||||||
//console.log(dat.data)
|
//console.log(dat.data)
|
||||||
|
|
||||||
@ -44,7 +42,7 @@ async function main() {
|
|||||||
|
|
||||||
let embed = {
|
let embed = {
|
||||||
title: event.name, //`${event.name} will start in <t:${event.start}:R>`,// <t:1636124400:R>
|
title: event.name, //`${event.name} will start in <t:${event.start}:R>`,// <t:1636124400:R>
|
||||||
description: turndownService.turndown(event.description),
|
description: event.description.replace(/\\n/gm, "\n"),
|
||||||
timestamp: moment.unix(event.start),
|
timestamp: moment.unix(event.start),
|
||||||
url: `https://furality.org/schedule#${event.id}`,
|
url: `https://furality.org/schedule#${event.id}`,
|
||||||
color: colour,
|
color: colour,
|
||||||
@ -63,8 +61,8 @@ async function main() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (event.image_url != "missing") {
|
if (event.image_url != "missing") {
|
||||||
embed.thumbnail = {
|
embed.image = {
|
||||||
url: `https://furality.org/${event.image_url}`,
|
url: event.image_url,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +70,6 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (evembeds.length > 0) {
|
if (evembeds.length > 0) {
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post(config.webhookurl, {
|
.post(config.webhookurl, {
|
||||||
embeds: evembeds,
|
embeds: evembeds,
|
||||||
|
29
package-lock.json
generated
29
package-lock.json
generated
@ -6,8 +6,7 @@
|
|||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1"
|
||||||
"turndown": "^7.1.1"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
@ -18,11 +17,6 @@
|
|||||||
"follow-redirects": "^1.14.4"
|
"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": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.14.5",
|
"version": "1.14.5",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
|
||||||
@ -49,14 +43,6 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"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": {
|
"dependencies": {
|
||||||
@ -68,11 +54,6 @@
|
|||||||
"follow-redirects": "^1.14.4"
|
"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": {
|
"follow-redirects": {
|
||||||
"version": "1.14.5",
|
"version": "1.14.5",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
|
||||||
@ -82,14 +63,6 @@
|
|||||||
"version": "2.29.1",
|
"version": "2.29.1",
|
||||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
||||||
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
|
"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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1"
|
||||||
"turndown": "^7.1.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user