Giter VIP home page Giter VIP logo

splatoon2-bot's People

Contributors

drinkoolongtea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

splatoon2-bot's Issues

插件在尝试读取本不需要读取的图片 导致报错

我在尝试启动插件或使用任意指令时,提示:

FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/.local/lib/python3.10/site-packages/splatoon2_tools/resource/ARMS_Institute.png'

插件在尝试读取ARMS_Institute.png,也就是隔壁ARMS Wiki的logo图片。

看了一眼Inkipedia页脚部分,发现正好这个ARMS Wiki就在底部友情链接的第一位,也就是说这个插件在寻找本来不需要寻找的图片,但由于仓库图片库根本不会有这些别的游戏的Wiki的图片,所以直接报错不工作。也许是网页抓取规则有未尽之处,让bot抓取了不必要的部分?因为这个友情链接部分的div class也是bubbleboxbg

启动插件报错了

最初版本没事 卸了老版本的插件安新的报错啥情况
NameError: name 'get_cookies' is not defined

卡顿

我在使用插件的时候,在响应指令时会出现卡顿,偶尔会导致整个nonebot卡死,这可能是由于wiki网站访问不稳定的情况下导致的,我给requests添加代理会有明显改善。建议在设置里添加是否使用代理的配置项
requests是否可以修改为异步的Httpx,这样是否会有所改善。
因为Splatoon2的地图是两个小时更新一次,是否可以提供一个每两个小时定时任务,去自动推送地图。

图片丢失

今天我的Bot在跑这个插件的时候,在生成打工图片时出现了错误。错误为图片丢失,具体目录为 splatoon2_tools\resource\Random_Rare.png
我没有在仓库中看到这个文件,不知道是否是作者忘记添加这张图片了,还是wiki上有新的页面更新。

时间错误。

我在实际使用的过程中,发现打工时间错误,我一直以为是Wiki上的错误,结果仔细对比后,发现是程序错误。我发现在网页抓取的时候,默认会显示UTC时间,这和我们所常用的时间是有时间差异的。正常情况下,程序应该都没有问题,但是当出现第二天的情况,比如打工时间结束刚好是00:00的时候,理论上日期已经是第二天了,但是日期并没有变化。

PIL生成图片的时候报错 OSError: cannot open resource

环境:Ubuntu Server 20.04,Python3.8,直接使用脚手架nb-cli安装,期间无报错,VPS中运行,故应该是没有中文语言环境的

安装启动后,发送命令报错,看起来像是因为没有加载到中文字体造成的?尝试直接apt安装中文字体 fonts-wqy-microhei ttf-wqy-zenhei 没有效果。想请教一下如何能解决,谢谢。

04-18 04:08:32 [ERROR] nonebot | Running matcher <Matcher from splatoon2_tools, type=message, priority=1, temp=False> failed.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/usr/lib/python3.8/multiprocessing/spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.8/dist-packages/nonebot/message.py", line 153, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/usr/local/lib/python3.8/dist-packages/nonebot/message.py", line 202, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/usr/local/lib/python3.8/dist-packages/nonebot/internal/matcher.py", line 668, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/usr/local/lib/python3.8/dist-packages/nonebot/internal/matcher.py", line 635, in simple_run
    await handler(
  File "/usr/local/lib/python3.8/dist-packages/nonebot/dependencies/__init__.py", line 92, in __call__
    return await self.call(**values)
  File "/usr/local/lib/python3.8/dist-packages/splatoon2_tools/__init__.py", line 25, in _handle
    await salmon_run.finish(MessageSegment.image(SplatoonInfo().get_ranked_battle()))
  File "/usr/local/lib/python3.8/dist-packages/splatoon2_tools/utils.py", line 27, in __init__
    self.china_font = ImageFont.truetype(str(china_font_path), 16, encoding="unic")
  File "/usr/local/lib/python3.8/dist-packages/PIL/ImageFont.py", line 878, in truetype
    return freetype(font)
  File "/usr/local/lib/python3.8/dist-packages/PIL/ImageFont.py", line 875, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/usr/local/lib/python3.8/dist-packages/PIL/ImageFont.py", line 226, in __init__
    self.font = core.getfont(
OSError: cannot open resource

功能寄了 功能寄了

从早上6点左右 功能全部失效,怀疑是wiki页面变动,你的bot运行是完美的嘛

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.