From 7bc2192c402d9d4ea8046a794daa6a289e721dec Mon Sep 17 00:00:00 2001 From: snowy Date: Sun, 1 Oct 2023 20:38:47 +0800 Subject: [PATCH] Update --- .gitignore | 1 + .idea/.gitignore | 3 ++ .idea/Liteyuki.iml | 8 ++++ .idea/inspectionProfiles/Project_Default.xml | 41 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ data/liteyuki/.keep | 0 main.py | 5 +++ plugins/.keep | 0 r.txt | 0 resources/.keep | 0 src/builtin/liteyuki_main/__init__.py | 11 +++++ .../liteyuki_plugin_manager/__init__.py | 0 src/builtin/liteyuki_plugin_manager/plugin.py | 1 + src/start.py | 30 ++++++++++++++ 17 files changed, 124 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/Liteyuki.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 data/liteyuki/.keep create mode 100644 main.py create mode 100644 plugins/.keep create mode 100644 r.txt create mode 100644 resources/.keep create mode 100644 src/builtin/liteyuki_main/__init__.py create mode 100644 src/builtin/liteyuki_plugin_manager/__init__.py create mode 100644 src/builtin/liteyuki_plugin_manager/plugin.py create mode 100644 src/start.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1d3ed4c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.yml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..359bb530 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/.idea/Liteyuki.iml b/.idea/Liteyuki.iml new file mode 100644 index 00000000..d0876a78 --- /dev/null +++ b/.idea/Liteyuki.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..039d8061 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,41 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..87885112 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..a347d08c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/data/liteyuki/.keep b/data/liteyuki/.keep new file mode 100644 index 00000000..e69de29b diff --git a/main.py b/main.py new file mode 100644 index 00000000..c6f8f205 --- /dev/null +++ b/main.py @@ -0,0 +1,5 @@ +from src.start import * + +if __name__ == '__main__': + liteyuki = Liteyuki() + liteyuki.start() \ No newline at end of file diff --git a/plugins/.keep b/plugins/.keep new file mode 100644 index 00000000..e69de29b diff --git a/r.txt b/r.txt new file mode 100644 index 00000000..e69de29b diff --git a/resources/.keep b/resources/.keep new file mode 100644 index 00000000..e69de29b diff --git a/src/builtin/liteyuki_main/__init__.py b/src/builtin/liteyuki_main/__init__.py new file mode 100644 index 00000000..8e719c91 --- /dev/null +++ b/src/builtin/liteyuki_main/__init__.py @@ -0,0 +1,11 @@ +print( + '''\033[34m __ ______ ________ ________ __ __ __ __ __ __ ______ +/ | / |/ |/ |/ \ / |/ | / |/ | / |/ | +$$ | $$$$$$/ $$$$$$$$/ $$$$$$$$/ $$ \ /$$/ $$ | $$ |$$ | /$$/ $$$$$$/ +$$ | $$ | $$ | $$ |__ $$ \/$$/ $$ | $$ |$$ |/$$/ $$ | +$$ | $$ | $$ | $$ | $$ $$/ $$ | $$ |$$ $$< $$ | +$$ | $$ | $$ | $$$$$/ $$$$/ $$ | $$ |$$$$$ \ $$ | +$$ |_____ _$$ |_ $$ | $$ |_____ $$ | $$ \__$$ |$$ |$$ \ _$$ |_ +$$ |/ $$ | $$ | $$ | $$ | $$ $$/ $$ | $$ |/ $$ | +$$$$$$$$/ $$$$$$/ $$/ $$$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$/ \033[0m''' +) \ No newline at end of file diff --git a/src/builtin/liteyuki_plugin_manager/__init__.py b/src/builtin/liteyuki_plugin_manager/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/builtin/liteyuki_plugin_manager/plugin.py b/src/builtin/liteyuki_plugin_manager/plugin.py new file mode 100644 index 00000000..ce65073e --- /dev/null +++ b/src/builtin/liteyuki_plugin_manager/plugin.py @@ -0,0 +1 @@ +from nonebot import on_command \ No newline at end of file diff --git a/src/start.py b/src/start.py new file mode 100644 index 00000000..f5620214 --- /dev/null +++ b/src/start.py @@ -0,0 +1,30 @@ +import threading +import nonebot +import yaml + +config = yaml.safe_load(open('config.yml', encoding='UTF-8')) + +class Liteyuki: + def __init__(self, params=None): + if params is None: + params = dict() + params.update() + + + kwargs = { + 'port': 11451, + 'host': '127.0.0.1', + 'nickname': ['Liteyuki'], + } + kwargs.update(config.get('nonebot', {})) + kwargs.update(params) + self.liteyuki_main = threading.Thread(target=nonebot.run) + self.running_state = 1 + nonebot.init(**kwargs) + + def start(self): + self.liteyuki_main.start() + nonebot.load_plugin('src.builtin.liteyuki_main') + + def stop(self): + pass \ No newline at end of file