| 333 | const bestMatch = fuse.search(reply, { limit: 1 }); | 333 | const bestMatch = fuse.search(reply, { limit: 1 }); |
| 334 | | 334 | |
| 335 | if (bestMatch.length == 0) { | 335 | if (bestMatch.length == 0) { |
| | 336 | for (const option of options) { |
| | 337 | if (String(reply).toLowerCase().includes(option.text.toLowerCase())) { |
| | 338 | console.debug('Fallback choosing background:', option); |
| | 339 | option.element.click(); |
| | 340 | return ''; |
| | 341 | } |
| | 342 | } |
| | 343 | |
| 336 | toastr.warning('No match found. Please try again.'); | 344 | toastr.warning('No match found. Please try again.'); |
| 337 | return ''; | 345 | return ''; |
| 338 | } | 346 | } |