worldbot's People
worldbot's Issues
Fix names with spaces/other symbols in them
As is already known, there are problems with names like the dark character "Alm / Arum" due to her having a slash in her name, and/or having spaces. Based on the code, you also cannot search !c Alm / Arum (which would be the found name in the database) because it splits every space, so Alm / Arum is the same as just writing Alm. To fix this, instead of checking if the input is equal to the name in the database, check if the database name contains the input at any point in the name. Examples of this here:
https://jsfiddle.net/x1c84aLt/ (excuse my laziness of displaying the data through printing rather than showing on html, and a lot of inefficient variable usage)
This uses either includes, match, indexOf or regex testing, to find part of names, I've put them in order from least to most efficient search. If I'm not mistaken all this would take would be a change in line 59 of the commands.js file to fit one of the given solutions.
With the current setup, includes or indexOf would be the easiest to implement as match and test requires creating a regex object to execute.
Searching japanese names
Assuming #2 makes the cut, it is very easy to implement searching for the japanese name and the english name at once. Realistically we would just assume that if it is not the english name, then it might be the japanese name.
To do this (and also include the change from #2) we would include the following (assuming the usage of indexOf)
const unit = global.CharacterData.find(char => char.ENName.toLowerCase().indexOf(chars.toLowerCase() != -1) || char.JPName.toLowerCase() == chars.toLowerCase());
Seeing as there is only one japanese name, we can assume that the input will always be exactly what the name is. This would also (albeit hacky) solve the issue of people trying to find Alm/Arum, as japanese names can be used.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.