1

I want to program a discord bot that is connected to a database. In the database are different words. If a user types a word (as an example picture) into the chat but misspelled it (as an example picture) he gets asked if the user wanted to search the word picture. Is something like this possible?

I searched for something like this but I couldn't find anything.

SlideGAW
  • 15
  • 3
  • 1
    I recommend using the damerau-levenshtein algorithm. It checks how similar the query is to a word. You can compare the query to each of the words you have and see if anything matches (steps <= ~2 or relative <= ~0.30 based on your own preference, see what works for you). You can see this awesome npm package that does it for you [here](https://www.npmjs.com/package/damerau-levenshtein). – Tetie Jan 24 '23 at 12:05

0 Answers0