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