added try catch to tesseract

pull/74/head
TheCodedProf 3 years ago
parent 4f9e97fb52
commit ca387af947

@ -198,12 +198,16 @@ export function TestString(
}
export async function TestImage(url: string): Promise<string | null> {
const text = await Tesseract.recognize(url, {
lang: "eng",
oem: 1,
psm: 3
});
return text;
try {
const text = await Tesseract.recognize(url, {
lang: "eng",
oem: 1,
psm: 3
});
return text;
} catch {
return null;
}
}
export async function doMemberChecks(member: Discord.GuildMember): Promise<void> {

Loading…
Cancel
Save