控制台日志输出截图:
mirai-console 控制台无额外输出
[2021-03-09 23:03:33,243][INFO]: initializing app...
Traceback (most recent call last):
File "D:/Download/mcl-1.0.5/plugins/test_bot.py", line 28, in
app.launch_blocking()
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application__init.py", line 1578, in launch_blocking
loop.run_until_complete(self.initialize())
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\init.py", line 1468, in initialize
await self.authenticate()
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\utilles.py", line 27, in wrapper
return await func(self, *args, **kwargs)
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\init__.py", line 310, in authenticate
raise_for_return_code(data)
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\utilles.py", line 114, in raise_for_return_code
raise exception_code
graia.application.exceptions.InvaildAuthkey
描述你遇到的问题: 文档示例运行失败
复现步骤: 该 BUG 会在进行以下操作后出现:
发生错误的代码 from graia.broadcast import Broadcast from graia.application import GraiaMiraiApplication, Session from graia.application.message.chain import MessageChain import asyncio
from graia.application.message.elements.internal import Plain from graia.application.friend import Friend
loop = asyncio.get_event_loop()
bcc = Broadcast(loop=loop) app = GraiaMiraiApplication( broadcast=bcc, connect_info=Session( host="http://localhost:8080", # 填入 httpapi 服务运行的地址 authKey="graia-mirai-api-http-authkey", # 用的这个authKey account=258***, # qq 号 websocket=True # Graia 已经可以根据所配置的消息接收的方式来保证消息接收部分的正常运作. ) )
@bcc.receiver("FriendMessage") async def friend_message_listener(app: GraiaMiraiApplication, friend: Friend): await app.sendFriendMessage(friend, MessageChain.create([ Plain("Hello, World!") ]))
app.launch_blocking()
控制台日志输出截图: mirai-console 控制台无额外输出 [2021-03-09 23:03:33,243][INFO]: initializing app... Traceback (most recent call last): File "D:/Download/mcl-1.0.5/plugins/test_bot.py", line 28, in
app.launch_blocking()
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application__init.py", line 1578, in launch_blocking
loop.run_until_complete(self.initialize())
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\init.py", line 1468, in initialize
await self.authenticate()
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\utilles.py", line 27, in wrapper
return await func(self, *args, **kwargs)
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\init__.py", line 310, in authenticate
raise_for_return_code(data)
File "C:\Users\TR\AppData\Local\Programs\Python\Python38\lib\site-packages\graia\application\utilles.py", line 114, in raise_for_return_code
raise exception_code
graia.application.exceptions.InvaildAuthkey
运行环境:
mirai-core
版本: 2.4.1mirai-api-http
版本: 1.9.8graia-application-mirai
版本: 0.17.0额外信息: