freepizzas-dev / onebot

A barebones Discord bot based on nextcord.py that includes some basic modules to play around with.
MIT License
6 stars 0 forks source link

/define is case sensitive #7

Closed laralove143 closed 10 months ago

laralove143 commented 10 months ago

in other words, /define foo doesn't yield the same result as /define Foo, in most cases, the latter doesn't return any response

rarely case does matter (as in /define Foo does return a response), so i think it'd be nice if it showed results for both lowercase (priority) and title case definitions

freepizzas-dev commented 10 months ago

Hi, thanks so much for taking the time to file an issue for oneBot!

Indeed, the /define and /etym commands are case sensitive by design. Users need a way to specify whether or not they're looking up a capitalized or lowercase definition in case of overlap.

But you're entirely correct that in (probably) 99.9% of cases, it doesn't matter. The majority of words on Wiktionary don't have case overlap like that. I think the best solution is to check for the case the user specifies first, then check the other case if there are no results and return that if it has a match.

Unless someone has a major issue with it, I'll be committing a patch to that effect within a few days, and the public version of oneBot will pick it up within a few days after that.

freepizzas-dev commented 10 months ago

Resolved in https://github.com/freepizzas-dev/onebot/commit/61a9c96a94f3314a3b8493ebff699fb5d43311e1