-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
51 lines (39 loc) · 1.21 KB
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import nonebot
import os
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
nonebot.init()
driver = nonebot.get_driver()
driver.register_adapter(ONEBOT_V11Adapter)
if not os.path.isdir("data"):
os.mkdir("data")
if not os.path.isfile("data/chatgpt.json"):
file = open("data/chatgpt.json", "w")
file.write("{}")
file.close()
if not os.path.isfile("data/gpt4.json"):
file = open("data/gpt4.json", "w")
file.write("{}")
file.close()
if not os.path.isfile("data/sign.json"):
file = open("data/sign.json", "w")
file.write("{}")
file.close()
if not os.path.isfile("data/broadcast.json"):
file = open("data/broadcast.json", "w")
file.write('{"data": []}')
file.close()
if not os.path.isfile("data/broadcastuser.json"):
file = open("data/broadcastuser.json", "w")
file.write('{"data": []}')
file.close()
if not os.path.isfile("data/blacklist.json"):
file = open("data/blacklist.json", "w")
file.write('{"data": []}')
file.close()
if not os.path.isfile("data/node.json"):
file = open("data/node.json", "w")
file.write('{"data": []}')
file.close()
nonebot.load_from_toml("pyproject.toml")
if __name__ == "__main__":
nonebot.run()