h-xiaoh / nonebot-plugin-apex-api-query Goto Github PK
View Code? Open in Web Editor NEWNoneBot Apex Legends API 查询插件
License: MIT License
NoneBot Apex Legends API 查询插件
License: MIT License
我在申请api过程中发现
Project description 一栏中如果填写中文的话申请的api key是无法使用的
在Dashboard界面会报404 Error,且直接返回Error: API key doesn't exist !
而且该api key无法再次登录会显示Sorry, no matching API key was found. Please try again.
在群里使用是正常的,但是在频道中使用虽然控制台有反应,但不会发送对应消息
03-10 22:56:57 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_apex_api_query)
03-10 22:56:57 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_apex_api_query) running complete
现在api不能申请了吗?申请后也绑定了discord,但是不能登陆我的api,测试失败
玩家UID太长了一般没什么人能记住
能让 绑定
在检测到玩家名称的时候绑定玩家名称而不是玩家UID吗?在检测到玩家UID的时候还是照常绑定UID
订阅地图轮换失败: The following arguments have not been supplied: api_t2i
订阅制造轮换失败: The following arguments have not been supplied: api_t2i
其他功能都可以正常运行,后台也没有报错
能正常返回文字 比如
正在查询: 地图轮换
正在查询: 顶尖猎杀者
但是结果在后台是报错
使用的是新版nonebot rc3虚拟环境
01-19 07:50:40 [INFO] nonebot_plugin_gocqhttp | [2821521344] 发送群 测试群(606749081) 的消息: [{"type": ... (1575284129)
01-19 07:50:41 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_apex_api_query) running complete
01-19 07:50:41 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_apex_api_query) failed.
Traceback (most recent call last):
File "", line 17, in
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run
uvicorn.run(
File "C:\BOT\BOT\test.venv\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\BOT\BOT\test.venv\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot\dependencies_init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot_plugin_apex_api_query_init_.py", line 79, in _
msg = t2i(service, response)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot_plugin_apex_api_query_init_.py", line 222, in t2i
pic = Txt2Img().draw(title, text)
File "C:\BOT\BOT\test.venv\lib\site-packages\nonebot_plugin_txt2img\txt2img.py", line 81, in draw
title_font = ImageFont.truetype(self.font_family, self.title_font_size)
File "C:\BOT\BOT\test.venv\lib\site-packages\PIL\ImageFont.py", line 1008, in truetype
return freetype(font)
File "C:\BOT\BOT\test.venv\lib\site-packages\PIL\ImageFont.py", line 1005, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\BOT\BOT\test.venv\lib\site-packages\PIL\ImageFont.py", line 255, in init
self.font = core.getfont(
OSError: cannot open resource
ModuleNotFoundError: No module named 'nonebot_plugin_apex_api_query'
我更换了nonebot nonebot2 都会提示这个问题,麻烦看一下应该怎么操作
nb: nonebot cli version 1.0.4
不太清楚如果大家共用同一个api会不会有问题,但需要手动申请一下api,希望写在readme或者加到配置项里
https://portal.apexlegendsapi.com/
[ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_apex_api_query) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1\bot.py", line 17, in
nonebot.run()
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot_init_.py", line 309, in
run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\drivers\fastapi.py", line
198, in run
uvicorn.run(
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\uvicorn\main.py", line 578, in run
server.run()
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\uvicorn\server.py", line 61, in ru
n
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_unt
il_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_
forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_for
ever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1909, in _run_o
nce
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\message.py", line 141, in
_check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\message.py", line 187, in
run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\internal\matcher\matcher.p
y", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\internal\matcher\matcher.p
y", line 728, in simple_run
await handler(
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\dependencies_init.py",
line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot_plugin_apex_api_query_in
it_.py", line 142, in crafting_func
msg = await t2i(service, response)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot_plugin_apex_api_query_in
it_.py", line 273, in t2i
pic = Txt2Img().draw(title, text)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot_plugin_txt2img\txt2img.py"
, line 81, in draw
title_font = ImageFont.truetype(self.font_family, self.title_font_size)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\PIL\ImageFont.py", line 996, in tr
uetype
return freetype(font)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\PIL\ImageFont.py", line 993, in fr
eetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\PIL\ImageFont.py", line 248, in __
init__
self.font = core.getfont(
OSError: cannot open resource
以上是报错的日志 似乎是没找到字体? 这是否和其他插件的字体会冲突? 想问问这个应该怎么解决 感谢大佬
[INFO] nonebot | Matcher(type='message', module=nonebot_plugin_apex_api_query) running complete
### ### 05-08 00:09:56 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_apex_api_query) failed.
Traceback (most recent call last):
File "", line 17, in
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_init_.py", line 309, in run
get_driver().run(*args, **kwargs)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\main.py", line 578, in run
server.run()
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
handle._run()
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\dependencies_init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_apex_api_query_init_.py", line 142, in crafting_func
msg = await t2i(service, response)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_apex_api_query_init_.py", line 273, in t2i
pic = Txt2Img().draw(title, text)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_txt2img\txt2img.py", line 81, in draw
title_font = ImageFont.truetype(self.font_family, self.title_font_size)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageFont.py", line 996, in truetype
return freetype(font)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageFont.py", line 993, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\14898.DESKTOP-G90AUDT\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageFont.py", line 248, in init
self.font = core.getfont(
OSError: cannot open resource
抱歉我是小白 不知道以何种方便的方式进行提问
Running Matcher(type='message', module=nonebot_plugin_apex_api_query) failed.
Traceback (most recent call last):
File "", line 17, in
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/init.py", line 333, in run
get_driver().run(*args, **kwargs)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/drivers/fastapi.py", line 199, in run
uvicorn.run(
File "/root/Arasi/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 587, in run
server.run()
File "/root/Arasi/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/message.py", line 467, in check_and_run_matcher
await _run_matcher(
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/message.py", line 419, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 759, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/internal/matcher/matcher.py", line 734, in simple_run
await handler(
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot/dependencies/init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot_plugin_apex_api_query/init.py", line 123, in map_func
msg = await t2i(service, response)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot_plugin_apex_api_query/init.py", line 280, in t2i
pic = Txt2Img().draw(title, text)
File "/root/Arasi/.venv/lib/python3.11/site-packages/nonebot_plugin_txt2img/txt2img.py", line 81, in draw
title_font = ImageFont.truetype(self.font_family, self.title_font_size)
File "/root/Arasi/.venv/lib/python3.11/site-packages/PIL/ImageFont.py", line 996, in truetype
return freetype(font)
File "/root/Arasi/.venv/lib/python3.11/site-packages/PIL/ImageFont.py", line 993, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/root/Arasi/.venv/lib/python3.11/site-packages/PIL/ImageFont.py", line 248, in init
self.font = core.getfont(
OSError: unknown file format
在查询eaid个人信息的时候提示我查询失败: API 错误: {"Error": "Your request has been declined because of server load issue, Origin refusing the connection or a wrong username."}或者是查询失败: API 错误: {"Error": "Player exists but has never played Apex Legends"}是什么原因呀
控制台无报错
还有赛季制造武器没有更新
添加一个绑定UID/ID的命令,绑定后群员发送查询玩家信息命令但不输入任何额外信息时,默认查询群员所绑定的账号
在第一次查询后记录地图轮换剩余时间,在轮换后自动查询发送到指定群/频道
我发现您在 handle 函数签名中并未指定 Bot 为 OneBot V11 的 Bot,却在部分 handle 里使用了 OneBot V11 的 MessageSegment,这会导致其他适配器的事件仍会被本插件的 matcher 所捕获。但由于您使用的是 OneBot V11 的 MessageSegment,消息可能无法发出并报错,同时阻断之后的事件处理流程。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.