mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Fix at messages with suffixed text
This commit is contained in:
parent
db1f4b2b52
commit
c466603193
@ -23,8 +23,10 @@ async def check(event: MessageEvent) -> bool:
|
|||||||
for seg in event.message:
|
for seg in event.message:
|
||||||
if seg.type == 'at':
|
if seg.type == 'at':
|
||||||
temp += f"[at:{seg.data['qq']}]"
|
temp += f"[at:{seg.data['qq']}]"
|
||||||
else:
|
elif isinstance(seg, str):
|
||||||
temp += seg
|
temp += seg
|
||||||
|
elif seg.type == 'text':
|
||||||
|
temp += seg.data["text"]
|
||||||
problem = temp
|
problem = temp
|
||||||
if problem:
|
if problem:
|
||||||
return await WordBank.check(event, problem) is not None
|
return await WordBank.check(event, problem) is not None
|
||||||
|
|||||||
@ -33,8 +33,10 @@ async def _(event: MessageEvent):
|
|||||||
for seg in event.message:
|
for seg in event.message:
|
||||||
if seg.type == 'at':
|
if seg.type == 'at':
|
||||||
temp += f"[at:{seg.data['qq']}]"
|
temp += f"[at:{seg.data['qq']}]"
|
||||||
else:
|
elif isinstance(seg, str):
|
||||||
temp += seg
|
temp += seg
|
||||||
|
elif seg.type == 'text':
|
||||||
|
temp += seg.data["text"]
|
||||||
problem = temp
|
problem = temp
|
||||||
elif text:
|
elif text:
|
||||||
problem = text
|
problem = text
|
||||||
|
|||||||
@ -117,8 +117,10 @@ async def _(
|
|||||||
_problem[0] = str(_problem[0])[str(_problem).index('问')+1:]
|
_problem[0] = str(_problem[0])[str(_problem).index('问')+1:]
|
||||||
temp = ''
|
temp = ''
|
||||||
for g in _problem:
|
for g in _problem:
|
||||||
if isinstance(g, str) or g.type == 'text':
|
if isinstance(g, str):
|
||||||
temp += g
|
temp += g
|
||||||
|
elif g.type == 'text':
|
||||||
|
temp += g.data['text']
|
||||||
elif g.type == 'at':
|
elif g.type == 'at':
|
||||||
temp += f"[at:{g.data['qq']}]"
|
temp += f"[at:{g.data['qq']}]"
|
||||||
problem = temp
|
problem = temp
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user