mirror of
https://github.com/MrTalon63/lets-go-gambling.git
synced 2026-03-09 09:17:58 +01:00
Fallback if LLM responds blank page
This commit is contained in:
parent
b94fa6ba0b
commit
91d033a0f3
1 changed files with 6 additions and 2 deletions
|
|
@ -14,16 +14,20 @@ export const run: RunFunction = async (client, message, args) => {
|
|||
try {
|
||||
req = await fetch(`https://text.pollinations.ai/${prompt}`);
|
||||
} catch {
|
||||
message.reply("Wystąpił błąd podczas generowania odpowiedzi");
|
||||
loadingMessage.edit("Wystąpił błąd podczas generowania odpowiedzi");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!req.ok) {
|
||||
message.reply("Wystąpił błąd podczas generowania odpowiedzi");
|
||||
loadingMessage.edit("Wystąpił błąd podczas generowania odpowiedzi");
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await req.text();
|
||||
if (!res) {
|
||||
loadingMessage.edit("Wystąpił błąd podczas generowania odpowiedzi");
|
||||
return;
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor("Blue")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue