commit 79917c8bb913c009dc00bf618194d74dd8137dc9 Author: Rock Chin Date: Wed Dec 7 16:48:32 2022 +0800 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f85c6b18 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.py \ No newline at end of file diff --git a/config-template.py b/config-template.py new file mode 100644 index 00000000..2c60ca9c --- /dev/null +++ b/config-template.py @@ -0,0 +1,22 @@ +mirai_http_api_config = { + "host": "", + "port": 8080, + "verifyKey": "", + "qq": 0 +} + +mysql_config = { + "host": "", + "port": 3306, + "user": "", + "password": "", + "database": "" +} + +openai_config = { + "api_key": "", +} + +completion_api_params = { + +} \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 00000000..f8a5a23b --- /dev/null +++ b/main.py @@ -0,0 +1,19 @@ +import os +import shutil + + +def main(): + # 检查是否有config.py,如果没有就把config-template.py复制一份,并退出程序 + if not os.path.exists('config.py'): + shutil.copy('config-template.py', 'config.py') + print('请先在config.py中填写配置') + return + # 导入config.py + assert os.path.exists('config.py') + import config + + print(config.mirai_http_api_config) + + +if __name__ == '__main__': + main() \ No newline at end of file