fix type hinting
This commit is contained in:
parent
4500bab91d
commit
b33470a412
@ -39,7 +39,7 @@ class KarmaDB:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.db_path = os.path.join("/", "var", "lib", "singerdbs", "karma.db")
|
self.db_path = os.path.join("/", "var", "lib", "singerdbs", "karma.db")
|
||||||
|
|
||||||
async def get_karma(self, keyword: str) -> str | int:
|
async def get_karma(self, keyword: str) -> int | dict:
|
||||||
async with sqlite3.connect(self.db_path, timeout=2) as db_conn:
|
async with sqlite3.connect(self.db_path, timeout=2) as db_conn:
|
||||||
async with db_conn.execute("SELECT score FROM karma WHERE keyword = ? LIMIT 1", (keyword,)) as db_cursor:
|
async with db_conn.execute("SELECT score FROM karma WHERE keyword = ? LIMIT 1", (keyword,)) as db_cursor:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user