mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
fix bug
This commit is contained in:
parent
02173dd8ff
commit
e67c117348
@ -25,9 +25,11 @@ update_ys_voice = on_command('更新原神语音资源', priority=12, permission
|
||||
|
||||
|
||||
async def download_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMessageEvent]):
|
||||
await bot.send(event, '资源尚未初始化,现在开始下载资源,这需要较长的时间,请耐心等待')
|
||||
await download_data.update_voice_data()
|
||||
await bot.send(event, '资源下载完成,请重新发送指令开始游戏')
|
||||
if not dir_name.exists():
|
||||
dir_name.mkdir(parents=True, exist_ok=True)
|
||||
await bot.send(event, '资源尚未初始化,现在开始下载资源,这需要较长的时间,请耐心等待')
|
||||
await download_data.update_voice_data()
|
||||
await bot.send(event, '资源下载完成,请重新发送指令开始游戏')
|
||||
|
||||
|
||||
@guess_game.handle()
|
||||
|
@ -36,7 +36,7 @@ dir_data.mkdir(parents=True, exist_ok=True)
|
||||
############
|
||||
|
||||
def init_db(db_dir, db_name='db.sqlite') -> SqliteDict:
|
||||
return SqliteDict(get_path(db_dir, db_name),
|
||||
return SqliteDict(str(get_path(db_dir, db_name)),
|
||||
encode=json.dumps,
|
||||
decode=json.loads,
|
||||
autocommit=True)
|
||||
|
@ -35,7 +35,7 @@ def init_db(db_dir, db_name='db.sqlite', tablename='unnamed') -> SqliteDict:
|
||||
db_cache_key = db_name + tablename
|
||||
if db.get(db_cache_key):
|
||||
return db[db_cache_key]
|
||||
db[db_cache_key] = SqliteDict(get_path(db_dir, db_name),
|
||||
db[db_cache_key] = SqliteDict(str(get_path(db_dir, db_name)),
|
||||
tablename=tablename,
|
||||
encode=json.dumps,
|
||||
decode=json.loads,
|
||||
|
Loading…
x
Reference in New Issue
Block a user