feat : 群组记录存储 && .gitingore
This commit is contained in:
+4
-1
@@ -173,4 +173,7 @@ cython_debug/
|
|||||||
|
|
||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
.*
|
.*
|
||||||
|
state.json
|
||||||
|
botpy.log*
|
||||||
|
joined_group.cfg
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
import group
|
||||||
|
|
||||||
from botpy.connection import ConnectionSession
|
from botpy.connection import ConnectionSession
|
||||||
from botpy.message import (Message)
|
from botpy.message import (Message)
|
||||||
@@ -127,11 +127,11 @@ class djtuWebsocket (Client) :
|
|||||||
# 加入群聊
|
# 加入群聊
|
||||||
new_group = True
|
new_group = True
|
||||||
if not groups is None :
|
if not groups is None :
|
||||||
for i in groups :
|
for i in groups.groups :
|
||||||
if i.find(gid) != -1 :
|
if i.find(gid) != -1 :
|
||||||
new_group = False
|
new_group = False
|
||||||
if new_group :
|
if new_group :
|
||||||
groups.append(gid)
|
groups.groups.append(gid)
|
||||||
# 解析指令
|
# 解析指令
|
||||||
commands:dict[str,types.MethodType|types.FunctionType] = {
|
commands:dict[str,types.MethodType|types.FunctionType] = {
|
||||||
r'吃什么' : lambda :"是啊吃什么"
|
r'吃什么' : lambda :"是啊吃什么"
|
||||||
@@ -160,7 +160,7 @@ class djtuWebsocket (Client) :
|
|||||||
# 广播
|
# 广播
|
||||||
try :
|
try :
|
||||||
msg = self.q.get()
|
msg = self.q.get()
|
||||||
for i in groups:
|
for i in groups.groups:
|
||||||
|
|
||||||
asyncio.create_task(self.api.post_group_message(i,content=msg))
|
asyncio.create_task(self.api.post_group_message(i,content=msg))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -173,7 +173,7 @@ bbyAccount = os.getenv("BOBBY_ACCOUNT")
|
|||||||
bbyPasswd = os.getenv("BOBBY_PASSWORD")
|
bbyPasswd = os.getenv("BOBBY_PASSWORD")
|
||||||
appid = os.getenv("APP_ID")
|
appid = os.getenv("APP_ID")
|
||||||
secret_bot = os.getenv("SECRET")
|
secret_bot = os.getenv("SECRET")
|
||||||
groups:list[str] = []
|
groups = group.GroupCtl()
|
||||||
|
|
||||||
if appid is None or secret_bot is None :
|
if appid is None or secret_bot is None :
|
||||||
raise SystemExit("未找到bot配置!")
|
raise SystemExit("未找到bot配置!")
|
||||||
|
|||||||
Reference in New Issue
Block a user