获取本地目录测试

This commit is contained in:
“QAQ” 2025-05-24 13:16:21 +08:00
parent 8997b1ebb3
commit d1d6307dc0

View File

@ -7,6 +7,7 @@ from .back import time_long, volume, isUserExist, insertUser, seconds_to_hms, ml
import pymysql import pymysql
import matplotlib import matplotlib
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import os
from .Tool import get_tool_name from .Tool import get_tool_name
import astrbot.api.message_components as Comp import astrbot.api.message_components as Comp
from astrbot.core.utils.session_waiter import ( from astrbot.core.utils.session_waiter import (
@ -402,7 +403,11 @@ class MyPlugin(Star):
@filter.command("本地目录测试") @filter.command("本地目录测试")
async def Juno(self, event: AstrMessageEvent): async def Juno(self, event: AstrMessageEvent):
yield event.plain_result("本地目录测试:") yield event.plain_result("本地目录测试:")
yield event.image_result("path/to/M.png") # 发送图片 file_path = os.path.abspath(__file__)
yield event.plain_result(file_path)
dir_path = os.path.dirname(file_path)
yield event.plain_result(dir_path)
yield event.image_result(dir_path + "/M.png") # 发送图片
@filter.command("部署") @filter.command("部署")