Coder Social home page Coder Social logo

nonebot-plugin-moyu's Introduction

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-moyu

✨ 摸鱼一时爽, 一直摸鱼一直爽 ✨

license pypi python

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-moyu
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-moyu
pdm
pdm add nonebot-plugin-moyu
poetry
poetry add nonebot-plugin-moyu
conda
conda install nonebot-plugin-moyu

打开 nonebot2 项目的 bot.py 文件, 在其中写入

nonebot.load_plugin('nonebot_plugin_moyu')

🎉 使用

指令表

指令 说明
摸鱼/摸鱼日历 查看今天的摸鱼日历
摸鱼/摸鱼日历+设置 以连续对话的形式设置摸鱼日历的推送时间
摸鱼/摸鱼日历+设置 小时:分钟 设置摸鱼日历的推送时间
摸鱼/摸鱼日历+状态 查看本群的摸鱼日历状态
摸鱼/摸鱼日历+禁用 禁用本群的摸鱼日历推送

nonebot-plugin-moyu's People

Contributors

a-kirami avatar lancercmd avatar mwtjc avatar yzyyz1387 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nonebot-plugin-moyu's Issues

摸不了鱼

API接口链接已经更新,但依旧无法摸
6BGWPHUW3X`ZZC)8GKHCL

[BUG]: 在发送命令“/摸鱼”之后,能获取摸鱼人日历图片链接,但是gocq图片上传失败,报错image type error: application/octet-stream,最终导致群消息发送失败:消息为空

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

nonebot: 2.0.0rc2; nonebot_plugin_gocqhttp: v1.0.0-rc3; 插件最新版;

问题描述

在发送命令“/摸鱼”之后,插件能获取摸鱼人日历图片链接(moyu_img),但是gocq图片上传失败,报错image type error: application/octet-stream,最终导致群消息发送失败:消息为空

日志如下:
12-22 22:59:32 [INFO] nonebot_plugin_gocqhttp | [3154035878] 收到群 猫娘的温暖小窝(995676811) 内 可爱阿福rua白猫(2364934266) 的消息: /摸鱼 (-555706903)
12-22 22:59:32 [SUCCESS] nonebot | OneBot V11 3154035878 | [message.group.normal]: Message -555706903 from 2364934266@[群:995676811] "/摸鱼"
12-22 22:59:32 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_moyu)
https://api.j4u.ink/proxy/redirect/moyu/calendar/20221222.png
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 警告: 群 995676811 图片上传失败: image type error: application/octet-stream
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 群消息发送失败: 消息为空.
12-22 22:59:32 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) running complete
12-22 22:59:32 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) failed.
Traceback (most recent call last):
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\bot.py", line 50, in
nonebot.run(app="mp_main:app")
File "D:\Python\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "D:\Python\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run
uvicorn.run(
File "D:\Python\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\Python\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\Python\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Python\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "D:\Python\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "D:\Python\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "D:\Python\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "D:\Python\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\Python\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\Python\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "D:\Python\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\src\plugins\nonebot_plugin_moyu_init_.py", line 106, in moyu
await matcher.finish(MessageSegment.image(moyu_img))
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 476, in finish
await cls.send(message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 461, in send
return await bot.send(event=event, message=_message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 220, in send
return await self.class.send_handler(self, event, message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 174, in send
return await bot.send_msg(**params)
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api
raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed

复现步骤

  1. 下载并将插件安装在bot上,Succeeded to import "src.plugins.nonebot_plugin_moyu"
  2. 在群聊中发送命令“/摸鱼”。
  3. 出现问题描述当中的报错。

预期行为

正常情况下应该响应命令"/摸鱼",发送摸鱼日历链接返回的图片。

实际行为

实际上bot无任何回复,并出现问题描述那样的报错。

日志信息

12-22 22:59:32 [INFO] nonebot_plugin_gocqhttp | [3154035878] 收到群 猫娘的温暖小窝(995676811) 内 可爱阿福rua白猫(2364934266) 的消息: /摸鱼 (-555706903)
12-22 22:59:32 [SUCCESS] nonebot | OneBot V11 3154035878 | [message.group.normal]: Message -555706903 from 2364934266@[群:995676811] "/摸鱼"
12-22 22:59:32 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_moyu)
https://api.j4u.ink/proxy/redirect/moyu/calendar/20221222.png
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 警告: 群 995676811 图片上传失败: image type error: application/octet-stream
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 群消息发送失败: 消息为空.
12-22 22:59:32 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) running complete
12-22 22:59:32 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) failed.
Traceback (most recent call last):
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\bot.py", line 50, in
nonebot.run(app="mp_main:app")
File "D:\Python\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "D:\Python\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run
uvicorn.run(
File "D:\Python\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\Python\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\Python\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Python\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "D:\Python\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "D:\Python\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "D:\Python\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "D:\Python\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\Python\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\Python\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "D:\Python\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\src\plugins\nonebot_plugin_moyu_init_.py", line 106, in moyu
await matcher.finish(MessageSegment.image(moyu_img))
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 476, in finish
await cls.send(message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 461, in send
return await bot.send(event=event, message=_message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 220, in send
return await self.class.send_handler(self, event, message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 174, in send
return await bot.send_msg(**params)
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api
raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed

额外补充

No response

我要摸鱼!

3CFN BQ DE@( L{}}QE}OOO
摸鱼已经更新到了0.3.0,HTTPX[http2]也安装了,但还是不能摸鱼

[BUG]: 已经不能正确返回图片了

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

2023年3月10日

问题描述

不能正确返回图片.

复现步骤

返回一个空的内容
image

预期行为

No response

实际行为

No response

日志信息

No response

额外补充

No response

[BUG]:

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

现版本

问题描述

使用功能出错

复现步骤

02-11 02:18:46 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_moyu) failed.
Traceback (most recent call last):
File "", line 17, in
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete
self.run_forever()
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever
self._run_once()
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1919, in _run_once
handle._run()
File "C:\Users\hlb\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run
await handler(
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot_plugin_moyu_init_.py", line 111, in moyu
await matcher.finish(MessageSegment.image(moyu_img))
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 481, in finish
await cls.send(message, **kwargs)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 466, in send
return await bot.send(event=event, message=message, **kwargs)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot_plugin_guild_patch_init
.py", line 19, in patched_send
return await original_send(self, event, message, **kwargs)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 220, in send
return await self.class.send_handler(self, event, message, **kwargs)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 174, in send
return await bot.send_msg(**params)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api
return handle_api_result(await self._result_store.fetch(seq, timeout))
File "F:\源代码\PY\noneBot\BotOne.venv\Lib\site-packages\nonebot\adapters\onebot\v11\utils.py", line 58, in handle_api_result
raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(data=None, echo='10', msg='SEND_MSG_API_ERROR', retcode=100, status='failed', wording='empty message')

预期行为

No response

实际行为

No response

日志信息

No response

额外补充

No response

api已变

https://api.j4u.ink/proxy/remote/moyu.json 改为 https://api.j4u.ink/v1/store/other/proxy/remote/moyu.json

已自行本地修改测试成功

[BUG]: 无法正确响应定时信息

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

现版本

问题描述

无法响应定时信息

复现步骤

/摸鱼 8:00
提示已经添加成功
但是8点的时候并没有反应.

预期行为

在八点发送图片

日志信息

No response

额外补充

No response

[BUG]: 现在获取不到摸鱼日历图片了

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

0.3.3

问题描述

}(B{Y67)%XF8EK5~0SEJMY8
现在每天获取到的都是同一张图片

复现步骤

每天获取到的都是同一张图片

预期行为

No response

日志信息

No response

额外补充

No response

Feature: 更换api

确认事项

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认功能并未实现。
  • 我确定在 GitHub Issues 中没有相同或相似的需求。

你希望能解决什么样的问题?

现有API侧连续多日无法获取正确图片

你想要的解决方案

摸鱼接口中列出了4个api源,经测试仅第二个能返回正确图片,其余似乎都年久失修

你考虑过的替代方案

No response

实现的功能是什么样的?

No response

还有什么要补充的吗?

No response

参与贡献

  • 我有足够的时间和能力,愿意为此提交 PR 来实现功能。

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.