exception handler
This commit is contained in:
@@ -13,18 +13,22 @@ class ClientController {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private sendMessage = async (): Promise<void> => {
|
private sendMessage = async (): Promise<void> => {
|
||||||
const href = await getFirstHtml();
|
try {
|
||||||
const { img, title } = await getImgTitle(href);
|
const href = await getFirstHtml();
|
||||||
|
const { img, title } = await getImgTitle(href);
|
||||||
this.client.channels.cache.forEach(async (channel) => {
|
|
||||||
if (channel.type !== "text") return null;
|
this.client.channels.cache.forEach(async (channel) => {
|
||||||
const embeddedMessage = new MessageEmbed().setTitle(title).setImage(img);
|
if (channel.type !== "text") return null;
|
||||||
const msg = await (channel as TextChannel).send(embeddedMessage);
|
const embeddedMessage = new MessageEmbed().setTitle(title).setImage(img);
|
||||||
const reactions = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"];
|
const msg = await (channel as TextChannel).send(embeddedMessage);
|
||||||
for (const reaction of reactions) {
|
const reactions = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"];
|
||||||
await msg.react(reaction);
|
for (const reaction of reactions) {
|
||||||
}
|
await msg.react(reaction);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user