mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-acgnshow.git
synced 2024-11-11 01:27:39 +08:00
12 lines
378 B
Python
12 lines
378 B
Python
from .config import BGIMAGE_PATH
|
|
import random
|
|
import datetime
|
|
def choose_random_bgimage():
|
|
randomfile = random.choice(list(BGIMAGE_PATH.iterdir()))
|
|
randomurl = randomfile.as_uri()
|
|
return randomurl
|
|
def convert_timestamp(timestamp):
|
|
obj = datetime.datetime.fromtimestamp(timestamp)
|
|
formatted_time = obj.strftime('%Y-%m-%d %H:%M:%S')
|
|
return formatted_time
|