From a9c87bf8293b064a9aa32cdfe40f3e5b4a63fb9b Mon Sep 17 00:00:00 2001 From: MxEmerson <2382413024@qq.com> Date: Tue, 17 Sep 2024 22:34:10 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0vscode=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=B8=8E=E8=B0=83=E8=AF=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 5 +---- .vscode/settings.json | 9 ++++++++- bot.py | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 bot.py diff --git a/.vscode/launch.json b/.vscode/launch.json index 3863b157..a41b847d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,12 +1,9 @@ { - // 使用 IntelliSense 了解相关属性。 - // 悬停以查看现有属性的描述。 - // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: Nonebot", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/bot.py", "console": "integratedTerminal", diff --git a/.vscode/settings.json b/.vscode/settings.json index 3516cb9e..7d94d367 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,10 @@ { - "python.formatting.provider": "autopep8" + "[python]": { + "diffEditor.ignoreTrimWhitespace": false, + "editor.defaultFormatter": "ms-python.autopep8", + "editor.formatOnType": true, + "editor.formatOnSave": true + }, + "python.languageServer": "Pylance", + "python.analysis.typeCheckingMode": "basic" } \ No newline at end of file diff --git a/bot.py b/bot.py new file mode 100644 index 00000000..7563acc9 --- /dev/null +++ b/bot.py @@ -0,0 +1,15 @@ +import nonebot +from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter + + + +nonebot.init() + +driver = nonebot.get_driver() +driver.register_adapter(ONEBOT_V11Adapter) + + +nonebot.load_from_toml("pyproject.toml") + +if __name__ == "__main__": + nonebot.run() \ No newline at end of file