From 54e60c00cb16794c315d39c225ee5357a41288ca Mon Sep 17 00:00:00 2001 From: Furina-1013-create <189647097+Furina-1013-create@users.noreply.github.com> Date: Mon, 25 Aug 2025 12:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E6=98=AF=E4=B8=80=E6=A0=B7=E7=9A=84?= =?UTF-8?q?=E4=B9=9F=E6=98=AF=E4=B8=BA=E4=B8=80=E9=94=AE=E5=8C=85=E5=8F=91?= =?UTF-8?q?=E5=B8=83release=E5=81=9A=E9=80=82=E9=85=8D=EF=BC=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __main__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 __main__.py diff --git a/__main__.py b/__main__.py new file mode 100644 index 000000000..4ce570197 --- /dev/null +++ b/__main__.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Bot项目的主入口点""" + +if __name__ == "__main__": + # 设置Python路径并执行bot.py + import sys + import os + from pathlib import Path + + # 添加当前目录到Python路径 + current_dir = Path(__file__).parent + sys.path.insert(0, str(current_dir)) + + # 执行bot.py的代码 + bot_file = current_dir / "bot.py" + with open(bot_file, 'r', encoding='utf-8') as f: + exec(f.read()) + + +# 这个文件是为了适配一键包使用的,在一键包项目之外没有用 \ No newline at end of file