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

Loading…
Cancel
Save