THEWHITEBOY503 / ConnMudaeClone

This bot is an open-source Discord card game, similar to Mudae. It allows you to draw a card every X hours (default 6), and even trade cards with your friends.
MIT License
5 stars 2 forks source link

user collection-specific add/remove commands #1

Closed MRSKnshnn closed 1 year ago

MRSKnshnn commented 1 year ago

Aside from commands to add/remove cards from the general card database, ideally there would also be commands to specifically add or remove cards from a specific user's collection. This would mostly be used in cases of card recalls or prize cards being given out during server events. Furthermore, with this separation of database and collections, removing cards from the general database should not have an effect on user collections. If a card is in a user's collection, it should not be removed upon the card being removed from the general database.

THEWHITEBOY503 commented 1 year ago

Furthermore, with this separation of database and collections, removing cards from the general database should not have an effect on user collections. If a card is in a user's collection, it should not be removed upon the card being removed from the general database.

This is not possible with the existing code structure. When a user has a card in their database, the row looks like this <Card ID> - <User ID> - <Draw ID> When a user views a card in their database, it looks at the cards that match their user ID, then takes the card ID and grabs the information from the card's database If a user is deleted from the server's database, the user's card has no ID to reference.

THEWHITEBOY503 commented 1 year ago

!add <ID> will add the card with the specified ID to the commanding user's database. !add <ID> @user will add the card with the specified ID to the tagged user's database !addcard "Card Name" "Image Link" "Color code (In 0xFFFFFF format)" Rarity will add a card to the general database. Please note that all values except for rarity need to be encased in quotation marks. This is because the name, link, and color are stored as text values, while rarity is stored as a numerical value. !removecard <Card ID> will remove the card from the database.

Note that all of these require server admin privs.