LambdaYH / zhenxun_plugin_weibo

移植自KokkoroBot-Multi-Platform,适配zhenxun_bot的微博推送插件
GNU General Public License v3.0
4 stars 0 forks source link

功能建议 #14

Closed Nenot233 closed 1 year ago

Nenot233 commented 1 year ago

有没有办法推送被@的人 例子: 用户名A被用户名B@了 检测到有人发送了@用户名A的微博,然后进行推送 检测关键词可以是@+用户名然后在搜索里面查找

LambdaYH commented 1 year ago

可以,有空去加上关键词检测

LambdaYH commented 1 year ago

https://github.com/LambdaYH/zhenxun_plugin_weibo/commit/eff2eaf9beb6254d27eaaf59f0eefd7f2ed807e5

理论上是可以了

Nenot233 commented 1 year ago

这个关键词检测是支持全微博吗?不单单只在一个用户里面检测关键字 因为其他人@博主的信息我也想推送

LambdaYH commented 1 year ago

这个关键词检测是支持全微博吗?不单单只在一个用户里面检测关键字 因为其他人@博主的信息我也想推送

所有,看配置就知道了,提供关键词就不用提供用户id

Nenot233 commented 1 year ago

这个关键词检测是支持全微博吗?不单单只在一个用户里面检测关键字 因为其他人@博主的信息我也想推送

所有,看配置就知道了,提供关键词就不用提供用户id

image image 自己测试了一下,好像没检测到

LambdaYH commented 1 year ago

因为最近没微博啊,3h前的微博直接忽略的

Nenot233 commented 1 year ago

可是,我发关键词的微博(关键词:image)也不会被检测到

LambdaYH commented 1 year ago

调用的是微博的搜索api image 你这个关键词确实搜出来是空的

Nenot233 commented 1 year ago

05-22 16:28:18 [ERROR] apscheduler | Job "_ (trigger: interval[0:00:20], next run at: 2023-05-22 16:28:35 CST)" raised an exception Traceback (most recent call last): File "D:\BOT\zhenxun_bot\bot.py", line 22, in nonebot.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, kwargs) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\uvicorn\main.py", line 569, in run server.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\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\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 634, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 601, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1905, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\apscheduler\executors\base_py3.py", line 30, in run_coroutine_job retval = await job.func(job.args, job.kwargs) File "D:\BOT\zhenxun_bot\extensive_plugin\zhenxun_pluginweibo__init__.py", line 262, in gl = [ File "D:\BOT\zhenxun_bot\extensive_plugin\zhenxun_plugin_weibo__init__.py", line 265, in if group_manager.check_group_task_status(g["group_id"], task) File "D:\BOT\zhenxun_bot\utils\manager\group_manager.py", line 41, in wrapper return func(*args, **kwargs) File "D:\BOT\zhenxun_bot\utils\manager\group_manager.py", line 70, in wrapper ] = Config.get_config("task", f"DEFAULT{task}", default=True) File "D:\BOT\zhenxun_bot\configs\utils\init__.py", line 179, in get_config raise NoSuchConfig(f"未查询到配置项 MODULE: [ {module} ] | KEY: [ {key} ]") configs.utils.NoSuchConfig: 未查询到配置项 MODULE: [ _task ] | KEY: [ DEFAULT_READ_60S ] 找到报错了

LambdaYH commented 1 year ago

你改过zhenxun代码了吧

File "D:\BOT\zhenxun_bot\utils\manager\group_manager.py", line 70, in wrapper
] = Config.get_config("task", f"DEFAULT{task}", default=True)```

https://github.com/HibiKier/zhenxun_bot/blob/0d3c6d86845cc11f71ed5ea82d95b2b3b93c4811/utils/manager/group_manager.py#L70

另外你居然不把插件所有文件放在同一个文件夹里面(

Nenot233 commented 1 year ago

我找到问题了read_60s这个插件里面有一行DEFAULT_READ_60S ,导致这个插件报错,删掉那行就解决了

LambdaYH commented 1 year ago

我找到问题了read_60s这个插件里面有一行DEFAULT_READ_60S ,导致这个插件报错,删掉那行就解决了

default的都是群被动,是不可能冲突的

Nenot233 commented 1 year ago

__plugin_task__ = {"read_60s": "60秒读世界"} 这一行,至于为啥我也过搞不明白),大概率是没写进cfg里面

LambdaYH commented 1 year ago

虽然解决方法很怪(但能用就行

Nenot233 commented 1 year ago

能用就行)