bot icon indicating copy to clipboard operation
bot copied to clipboard

Faulty tag suggestions

Open anand2312 opened this issue 4 years ago • 4 comments

On making a typo with a tag, any additional text that was sent along with it is also sent in the "Did you mean..." embed.

Example

The fuzzy matching also seems a bit odd here, with pste being matched to site instead of paste.

anand2312 avatar Feb 24 '21 06:02 anand2312

As to why it happens, https://github.com/python-discord/bot/blob/master/bot/exts/backend/error_handler.py#L208 shows that we simply use .replace on user input, we probably could simply just put the suggested command name instead of parsing whole user input and replacing it with suggestion. Would you like to work on it?

Senjan21 avatar Feb 25 '21 16:02 Senjan21

I'm busy currently; anyone is free to work on this.

anand2312 avatar Feb 25 '21 17:02 anand2312

The fuzzy matching also seems a bit odd here, with pste being matched to site instead of paste.

Yeah, I guess difflib.get_close_matches finds multiple matches but we only chose the first one (because n is 1). With testing I found out that if the cutoff is 0.8, then it only matches paste and not site. Although that might make other matching be less accurate.

ToxicKidz avatar Mar 17 '21 14:03 ToxicKidz

It also seems that the error handler doesn't try to make suggestions for tags, and !paste is a tag, and the cutoff isn't the problem because paste is a closer match.

ToxicKidz avatar Mar 17 '21 15:03 ToxicKidz

Closed in 2025 review of open issues. We do not feel there is a large need for this feature.

jb3 avatar Jul 22 '25 19:07 jb3