Skip to content

AssertionError 出现该报错 #246

Description

@LoCCai
08-05 22:17:13 [INFO] nonebot | Matcher(type='notice', module=nonebot_plugin_pixivbot.handler.sniffer.poke, lineno=38) running complete
08-05 22:17:13 [ERROR] nonebot | Running Matcher(type='notice', module=nonebot_plugin_pixivbot.handler.sniffer.poke, lineno=38) failed.       
Traceback (most recent call last):
  File "/app/pixiv/.venv/lib/python3.11/site-packages/ssttkkl_nonebot_utils/errors/error_handler.py", line 88, in run_excepting               
    await coro                                
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 40, in receive_error_message
    await handler.post_plain_text(msg) 
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 207, in post_plain_text              
    await context.require(Postman).post_plain_text(message, self.session, self.event)
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/service/postman.py", line 82, in post_plain_text                       
    await self._post(msg, session, event)
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/service/postman.py", line 73, in _post     
    await msg.send(reply=True)                                                                                   
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_saa/abstract_factories.py", line 392, in send      
    return await self._do_send(bot, target, event, at_sender, reply)            
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_saa/abstract_factories.py", line 456, in _do_send      
    return await sender(bot, self, target, event, at_sender, reply)
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_saa/adapters/onebot_v11.py", line 187, in send         
    assert isinstance(event, MessageEvent)   
AssertionError                                                                                                                                                                                                                    
                                                        
During handling of the above exception, another exception occurred:                                                                                                                                                               
                                                        
Traceback (most recent call last):                                                                                                                                                                                                
  File "<string>", line 17, in <module>                                                                          
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/__init__.py", line 337, in run                                                                                                                                      
    get_driver().run(*args, **kwargs)                                                                            
  File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/drivers/fastapi.py", line 187, in run                                                                                                                               
    uvicorn.run(                          
  File "/app/pixiv/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 580, in run
    server.run()                                                                                                                                                                                                                  
  File "/app/pixiv/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run                                                                                                                                         
    return asyncio.run(self.serve(sockets=sockets))                                                                                                                                                                               
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run                                                                                                                                                           
    return runner.run(main)                                                                                                                                                                                                       
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run

return runner.run(main) [0/1982]
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/utils.py", line 254, in run_coro_with_shield
return await coro
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/message.py", line 506, in check_and_run_matcher
await _run_matcher(

File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/message.py", line 458, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 926, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 863, in simple_run
await handler(
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot/dependencies/init.py", line 113, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/sniffer/poke.py", line 40, in on_match
await PokeHandler(session, event).handle()
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 111, in handle
await self.interceptor.intercept(self, self._parse_args_and_actual_handle, *args, **kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 54, in intercept
await self.x.intercept(
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 54, in intercept
await self.x.intercept(
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 54, in intercept
await self.x.intercept(
[Previous line repeated 2 more times]
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/service_interceptor.py", line 35, in intercept
await wrapped_func(*args, **kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 43, in intercept
await wrapped_func(*args, **kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/timeout_interceptor.py", line 17, in intercept
await wait_for(wrapped_func(*args, **kwargs),
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 489, in wait_for
return fut.result()
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/loading_prompt_interceptor.py", line 24, in intercept
await wrapped_func(*args, **kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/retry_interceptor.py", line 28, in intercept
raise e
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/retry_interceptor.py", line 23, in intercept
return await wrapped_func(*args, **kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/interceptor/record_req_interceptor.py", line 16, in intercept
await wrapped_func(*args, **kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 124, in _parse_args_and_actual_handle
await self.actual_handle(**kwargs)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/common/random_recommended_illust.py", line 31, in actual_handle
await self.post_illusts(illusts,
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 223, in post_illusts
await self.post_illust(illusts[0], header=header, number=number)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 217, in post_illust
await context.require(Postman).post_illusts(model, self.session, self.event)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/handler/recorder.py", line 77, in post_illusts
await self.delegation.post_illusts(model, session, event)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/service/postman.py", line 100, in post_illusts
await self.post_illust(x, session, event)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/service/postman.py", line 92, in post_illust
await self._post(msg, session, event)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_pixivbot/service/postman.py", line 73, in _post
await msg.send(reply=True)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_saa/abstract_factories.py", line 392, in send
return await self._do_send(bot, target, event, at_sender, reply)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_saa/abstract_factories.py", line 456, in _do_send
return await sender(bot, self, target, event, at_sender, reply)
File "/app/pixiv/.venv/lib/python3.11/site-packages/nonebot_plugin_saa/adapters/onebot_v11.py", line 187, in send
assert isinstance(event, MessageEvent)
AssertionError

与ssa有关, @register_sender(SupportedAdapters.onebot_v11)
async def send(
bot,
msg: MessageFactory,
target,
event,
at_sender: bool,
reply: bool,
) -> OB11Receipt:
assert isinstance(bot, BotOB11)
assert isinstance(target, (TargetQQGroup, TargetQQPrivate))
if event:
assert isinstance(event, MessageEvent)
full_msg = assamble_message_factory(
msg,
Mention(event.get_user_id()),
Reply(OB11MessageId(message_id=event.message_id)),
at_sender,
reply,
)
else:
full_msg = msg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions