mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-acgnshow.git
synced 2025-09-06 12:16:25 +00:00
添加新设置项,拆分css
This commit is contained in:
@ -1,16 +1,17 @@
|
||||
import os
|
||||
import random
|
||||
import datetime
|
||||
|
||||
from .config import BGIMAGE_PATH
|
||||
from pathlib import Path
|
||||
from .config import config
|
||||
|
||||
|
||||
def choose_random_bgimage() -> str:
|
||||
"""
|
||||
从背景图片文件夹中随机选择一张图片,返回图片的uri地址
|
||||
"""
|
||||
randomfile = random.choice(os.listdir(BGIMAGE_PATH))
|
||||
randomurl = (BGIMAGE_PATH / randomfile).as_uri()
|
||||
bgpath = Path(config.acgnshow_bgimage_path)
|
||||
randomfile = random.choice(os.listdir(bgpath))
|
||||
randomurl = (bgpath / randomfile).as_uri()
|
||||
return randomurl
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user