rongrongji / nonebot_plugin_quote Goto Github PK
View Code? Open in Web Editor NEWNonebot2插件:一款QQ群语录库——支持上传聊天截图为语录,随机投放语录,关键词搜索语录精准投放
Nonebot2插件:一款QQ群语录库——支持上传聊天截图为语录,随机投放语录,关键词搜索语录精准投放
系统信息:
Windows Server 2019 Datacenter + Python3.10
上传图片如下:
疑似错误字符:【】这个括号
报错如下:
03-26 20:58:16 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_quote)
03-26 20:58:18 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_quote) running complete
03-26 20:58:18 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_quote) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\NoneBot\GZbot2\bot.py", line 36, in <module>
nonebot.run(app="__mp_main__:app")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\__init__.py", line 273, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\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 636, 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 603, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1906, 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:\Users\Administrator\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\Administrator\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\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run
await handler(
File "C:\Users\Administrator\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\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_quote\__init__.py", line 104, in record_upload
json.dump(inverted_index, fc, indent=2, separators=(',',': '), ensure_ascii=False)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 180, in dump
fp.write(chunk)
UnicodeEncodeError: 'gbk' codec can't encode character '\xdf' in position 1: illegal multibyte sequence
需要在RECORD_PATH和INVERTED_INDEX_PATH中手动创建两个json文件 这段不止到出了啥岔子了,换了好几个写法都提示路径填写错误或找不到文件。想问问标准写法是什么?
另外,QUOTE_SUPERUSER里必须分群设置管理员qq号么?有没有全局的设置的?
请教个问题,文件存在哪的呢,是存在互联网上的吗?到期时间是多少呢?
参考copy_images_files函数,应该可以在保存图片的时候直接保存到用户设定好的image_path,例如bot/resources/image/,这样应该会更便于用户管理资源以及对接其他插件功能
如果在触发了上传指令后想要退出上传进程,似乎没有指令可以做到(?)而且bot会每条消息都回复让他上传图片形式…>_<…
希望能加一个取消上传的指令,可以取消上传,感谢!
能否在上传语录时就为其添加标签
目前添加tag似乎需要Bot将语录发出,可如果语录存储较多,为特点语录添加tag是不是较为困难
可以给quote插件单独加个前缀嘛(*≧ω≦)通过.env 配置,默认空
原因:部分指令(addtag)与部分插件(ELF_RSS)的指令冲突了 也是为了防止误触发。
感谢!
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.