首次提交
This commit is contained in:
12
danding_bot/plugins/onmyoji_gacha/utils.py
Normal file
12
danding_bot/plugins/onmyoji_gacha/utils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import os
|
||||
from typing import Union, Optional
|
||||
from pathlib import Path
|
||||
|
||||
def get_image_path(file_path: str) -> str:
|
||||
"""获取图片的绝对路径"""
|
||||
return os.path.abspath(file_path)
|
||||
|
||||
def format_user_mention(user_id: str, user_name: Optional[str] = None) -> str:
|
||||
"""格式化用户@信息"""
|
||||
display_name = user_name if user_name else f"用户{user_id}"
|
||||
return f"@{display_name}"
|
||||
Reference in New Issue
Block a user