lgc-nb2dev / nonebot-plugin-autoreply Goto Github PK
View Code? Open in Web Editor NEW配置文件高度可自定义的自动回复插件
Home Page: https://autoreply.lgc2333.top
License: MIT License
配置文件高度可自定义的自动回复插件
Home Page: https://autoreply.lgc2333.top
License: MIT License
添加热重载或者自动重载配置文件,改一次重启一下qqbot有点麻烦
支持QQ聊天指令添加词条
添加单个词条登录服务器修改有些麻烦,希望能够通过QQ聊天指令更方便地添加词条
入题,当一个群友回复另一个群友时,插件好像会将回复的原消息和回复的消息合并起来检测
可不可以加入是否检测原消息的选项qwq
如题,我想设定一个只对群内指定用户生效的自动回复规则
[
{
"matches": [
{
"match": "114514",
"type": "full",
"to_me": false,
"from": 10000 // 新增的match字段,10000为发送人qq号(发送人id)
}
],
"replies": ["1919810"]
}
]
只有10001发送114514时,bot才会回复1919810。其他人发送114514并不会触发这个回复。
04-29 23:31:04 [ERROR] nonebot | Failed to import "nonebot_plugin_autoreply"
Traceback (most recent call last):
File "", line 1, in
File "/root/anaconda3/envs/nonebot2/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/root/anaconda3/envs/nonebot2/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/root/anaconda3/envs/nonebot2/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/uvicorn/config.py", line 477, in load
self.loaded_app = import_from_string(self.app)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/root/nonebot2/MIbot/./bot.py", line 26, in
nonebot.load_from_toml("pyproject.toml")
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/root/anaconda3/envs/nonebot2/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot_plugin_autoreply/init.py", line 3, in
from . import main as main
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot_plugin_autoreply/main.py", line 30, in
from nonebot_plugin_autoreply.util import VarDictType, get_var_dict, replace_message_var
File "/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot_plugin_autoreply/util.py", line 4, in
from nonebot.adapters.onebot.utils import f2s
ImportError: cannot import name 'f2s' from 'nonebot.adapters.onebot.utils' (/root/anaconda3/envs/nonebot2/lib/python3.9/site-packages/nonebot/adapters/onebot/utils.py)
如何在回复内容里面添加换行呢?
[CQ:api,api=xxx,param1=yyy,param2=zzz]
{random|\d|\d}
,Dict[str, Callable[..., Any]]
RT 今天在bot上部署插件的时候发现多个match的回复匹配不上了 0.2.0版本是不再支持多个match了吗
1、触发回复的CD
每个match有不同的CD时长设置,每个聊天(私聊或是群)独立CD
2、在replies中可以输入特殊的字段,能够解析出触发该match的人,来实现在回复中@。(似乎不是很有必要
例如,将{someone_qqid}
处理过后变为这个人的QQ号,放入CQ码中实现@
或者说,直接使用特殊字段进行@,不转化为QQ号
然后遵循现在的一些特性,比如当type=plain
时,不处理特殊字段......
谢谢!
如题,我想机器人匹配@机器人的消息(不带任何文本的),我尝试过
`
排查了没有思路..
环境是Win11 py3.8
02-22 15:23:14 [ERROR] nonebot | Failed to import "nonebot_plugin_autoreply"
Traceback (most recent call last):
File "bot.py", line 14, in
nonebot.load_plugins("plugins")
File "C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-gM3lmNrj-py3.8\lib\site-packages\nonebot\plugin\load.py", line 45, in load_plugins
return manager.load_all_plugins()
File "C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-gM3lmNrj-py3.8\lib\site-packages\nonebot\plugin\manager.py", line 168, in load_all_plugins
return set(
File "C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-gM3lmNrj-py3.8\lib\site-packages\nonebot\plugin\manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-gM3lmNrj-py3.8\lib\site-packages\nonebot\plugin\manager.py", line 145, in load_plugin
module = importlib.import_module(
File "d:\python\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in load_unlocked
File "C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-gM3lmNrj-py3.8\lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 848, in exec_module
File "", line 219, in call_with_frames_removed
File "D:\zhenxun_bot\plugins\nonebot_plugin_autoreply_init.py", line 3, in
from .main import * # noqa
File "D:\zhenxun_bot\plugins\nonebot_plugin_autoreply_main.py", line 37, in
will_check: Iterable[tuple[Unpack[TArgs]]],
TypeError: 'type' object is not subscriptable
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.