Closed kihashi closed 9 years ago
Alternate approach would be to add a new DB class called nickname with 2 fields: nickname and card. Cards with multiple nicks would have several nickname objects. The problem with this is that it would add a step to database creation.
1. init_db.py
2. mtgjson.py Allsets-x.json
3. nick.py
Of course, this would all be scripted, so I am not sure it is that big of a deal.
I am thinking that perhaps bot admins should be able to add card nicknames on the fly via an .addnick command:
Admin: .addnick Jace, The Mind Sculptor | Papa Jace
Cardbot: "Jace, the Mind Sculptor" now can be accessed by the nickname "Papa Jace"
OR
Cardbot: The nickname "Papa Jace" is already being used by the card "Jace, The Living Guildpact"
OR
Cardbot: "Papa Jace" cannot be used as a nickname because it is the name of a card.
I decided to go with the DB approach.
I added a DB entity for card nicknames, added a search for them, and then updated the nickname file to add them to the database. I did have to add an extra step to paver, but I think that this will make nicknames more featureful in the future.
Add a database field for cards to hold a list of card nicknames.