Skip to content

Commit 933bb0b

Browse files
authored
Merge pull request #2579 from 6vision/web_channel_bug_fix
Fix: fix 'NoneType' object does not support item assignment error (#2525)
2 parents 3db5e70 + 931fbc3 commit 933bb0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

channel/chat_channel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def _compose_context(self, ctype: ContextType, content, **kwargs):
146146
elif context["origin_ctype"] == ContextType.VOICE: # 如果源消息是私聊的语音消息,允许不匹配前缀,放宽条件
147147
pass
148148
else:
149+
logger.info("[chat_channel]receive single chat msg, but checkprefix didn't match")
149150
return None
150151
content = content.strip()
151152
img_match_prefix = check_prefix(content, conf().get("image_create_prefix",[""]))

channel/web/web_channel.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ def post_message(self):
156156
from_user_id=user_id,
157157
other_user_id = user_id
158158
))
159-
context["isgroup"] = False
160-
# context["session"] = web.storage(session_id=user_id)
161-
162159
if not context:
163160
return json.dumps({"status": "error", "message": "Failed to process message"})
161+
162+
context["isgroup"] = False
163+
# context["session"] = web.storage(session_id=user_id)
164164

165165
self.produce(context)
166166
return json.dumps({"status": "success", "message": "Message received"})
@@ -176,7 +176,6 @@ def chat_page(self):
176176
return f.read()
177177

178178
def startup(self):
179-
logger.setLevel("WARN")
180179
print("\nWeb Channel is running, please visit http://localhost:9899/chat")
181180

182181
urls = (

0 commit comments

Comments
 (0)