kihashi / mtg-irc

A module for the IRC Bot Phenny that allows users to query magic cards.
3 stars 1 forks source link

Card Nicknames #46

Closed kihashi closed 9 years ago

kihashi commented 10 years ago

Add a database field for cards to hold a list of card nicknames.

kihashi commented 10 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.

kihashi commented 10 years ago

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.
kihashi commented 9 years ago

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.