Added table and general functions for stats system #21

Merged
waifu merged 16 commits from stats_system into dev 2025-06-25 20:45:13 -07:00
Showing only changes of commit cce941471f - Show all commits

View file

@ -166,10 +166,23 @@ def is_player_administrator(username: str) -> bool:
def insert_card(
name: str, rarity: int, file_id: str) -> int:
name: str, rarity: int, file_id: str,
power: int =None, charm: int = None, wit: int = None) -> int:
'''Inserts a card'''
if power is not None and charm is not None and wit is not None:
CURSOR.execute(
'INSERT INTO cards (name, rarity, file_id) VALUES (?, ?, ?)',
'''
INSERT INTO card (name, rarity, file_id, power, charm, wit)
VALUES (?, ?, ?, ?, ?, ?)
''',
(name, rarity, file_id, power, charm, wit)
)
else:
CURSOR.execute(
'''
INSERT INTO card (name, rarity, file_id)
VALUES (?, ?, ?)
''',
(name, rarity, file_id)
)
card_id = CURSOR.lastrowid