nonebot-plugin-acgnshow/nonebot_plugin_acgnshow/util.py

6 lines
188 B
Python
Raw Normal View History

2024-07-11 18:26:21 +08:00
from .config import BGIMAGE_PATH
import random
from pathlib import Path
def choose_random_bgimage():
randomfile = random.choice(list(BGIMAGE_PATH.iterdir()))
return str(randomfile)