Switched to content.embeds

This commit is contained in:
Essem 2021-11-09 22:09:10 -06:00
parent ef5023b639
commit fae75db44a
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
19 changed files with 195 additions and 197 deletions

View file

@ -12,12 +12,12 @@ class AncientCommand extends Command {
const data = await fetch("https://projectlounge.pw/meme/", { redirect: "manual", signal: controller.signal });
clearTimeout(timeout);
return {
embed: {
embeds: [{
color: 16711680,
image: {
url: data.headers.get("location")
}
}
}]
};
} catch (e) {
if (e.name === "AbortError") {

View file

@ -7,12 +7,12 @@ class BirdCommand extends Command {
const imageData = await fetch("http://shibe.online/api/birds");
const json = await imageData.json();
return {
embed: {
embeds: [{
color: 16711680,
image: {
url: json[0]
}
}
}]
};
}

View file

@ -12,13 +12,12 @@ class CatCommand extends Command {
const data = await fetch("https://projectlounge.pw/cta/", { redirect: "manual", signal: controller.signal });
clearTimeout(timeout);
return {
embed: {
embeds: [{
color: 16711680,
description: "Cat images are sourced from a subset of the [dm4catbot](https://twitter.com/dm4catbot) database.",
image: {
url: data.headers.get("location")
}
}
}]
};
} catch (e) {
if (e.name === "AbortError") {

View file

@ -7,12 +7,12 @@ class DogCommand extends Command {
const imageData = await fetch("https://dog.ceo/api/breeds/image/random");
const json = await imageData.json();
return {
embed: {
embeds: [{
color: 16711680,
image: {
url: json.message
}
}
}]
};
}

View file

@ -7,18 +7,17 @@ class XKCDCommand extends Command {
try {
const request = await fetch(url);
const json = await request.json();
const embed = {
"embed": {
"title": json.safe_title,
"url": `https://xkcd.com/${json.num}`,
"color": 16711680,
"description": json.alt,
"image": {
"url": json.img
return {
embeds: [{
title: json.safe_title,
url: `https://xkcd.com/${json.num}`,
color: 16711680,
description: json.alt,
image: {
url: json.img
}
}
}]
};
return embed;
} catch {
return "I couldn't get that XKCD!";
}