Comments (19)
将python版本升级到3.9及以上
from nonebot-bison.
装了3.9才试的
试了prts-forward-bot那个也是一模一样的情况
from nonebot-bison.
好吧我的锅,我去看了一下Python版本是3.8.6,但是我装了3.9.2的包的,我再试一下
from nonebot-bison.
0.2.4修复了nb-cli安装本插件的问题(但是需要python3.9)
from nonebot-bison.
换了Python 3.9后正常安装了,但是群里@机器人仍然无响应
02-26 20:14:24 [INFO] uvicorn | ('127.0.0.1', 49693) - "WebSocket /cqhttp/ws" [accepted]
02-26 20:14:24 [INFO] nonebot | WebSocket Connection from CQHTTP Bot 34467 Accepted!
02-26 20:14:58 [INFO] nonebot | CQHTTP 34467 | [message.group.normal]: Message -1465708659 from 28647@[群:104*******72] "添加订阅"
02-26 20:14:58 [DEBUG] nonebot | Checking for matchers in priority 1...
02-26 20:14:58 [DEBUG] nonebot | Checking for matchers in priority 5...
02-26 20:16:59 [INFO] nonebot | CQHTTP 3467 | [message.group.normal]: Message 833248823 from 28447@[群:1045******72] "查询订阅"
02-26 20:16:59 [DEBUG] nonebot | Checking for matchers in priority 1...
02-26 20:16:59 [DEBUG] nonebot | Checking for matchers in priority 5...
from nonebot-bison.
确定你是群管理或者群主,如果还不行就在.env中指明dev模式看更详细的log
from nonebot-bison.
我是群主,好像机器人这边没有识别@的消息,我看其他正常聊天的消息也是上面那个代码格式
dev模式咋进orz
from nonebot-bison.
新建一个.env文件指定ENVIRONMENT https://v2.nonebot.dev/guide/basic-configuration.html
from nonebot-bison.
.env中原来就有ENVIRONMENT=dev
.env.dev中也有DEBUG=true喔
from nonebot-bison.
贴下完整日志吧
from nonebot-bison.
PS C:\Users\Administrator\Downloads\PRTS1> nb run
02-26 20:51:36 [INFO] nonebot | NoneBot is initializing...
02-26 20:51:36 [INFO] nonebot | Current Env: dev
02-26 20:51:36 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('127.0.0.1'),
'port': 8080, 'debug': True, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': se
t(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(secon
ds=120), 'environment': 'dev'}
02-26 20:51:36 [DEBUG] nonebot | Succeeded to load adapter "cqhttp"
02-26 20:51:36 [INFO] nonebot | Succeeded to import "nonebot.plugins.echo"
02-26 20:51:36 [INFO] nonebot | Succeeded to import "nonebot_plugin_apscheduler"
02-26 20:51:36 [INFO] nonebot | Succeeded to import "nonebot_hk_reporter"
02-26 20:51:36 [INFO] nonebot | Running NoneBot...
02-26 20:51:36 [DEBUG] nonebot | Loaded adapters: cqhttp
02-26 20:51:36 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
02-26 20:51:36 [INFO] uvicorn | Started reloader process [2840] using statreload
02-26 20:51:37 [INFO] nonebot | NoneBot is initializing...
02-26 20:51:37 [INFO] nonebot | Current Env: dev
02-26 20:51:37 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('127.0.0.1'),
'port': 8080, 'debug': True, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': se
t(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(secon
ds=120), 'environment': 'dev'}
02-26 20:51:37 [DEBUG] nonebot | Succeeded to load adapter "cqhttp"
02-26 20:51:37 [INFO] nonebot | Succeeded to import "nonebot.plugins.echo"
02-26 20:51:37 [INFO] nonebot | Succeeded to import "nonebot_plugin_apscheduler"
02-26 20:51:37 [INFO] nonebot | Succeeded to import "nonebot_hk_reporter"
02-26 20:51:37 [INFO] uvicorn | Started server process [2788]
02-26 20:51:37 [INFO] uvicorn | Waiting for application startup.
02-26 20:51:37 [INFO] nonebot_plugin_apscheduler | Scheduler Started
02-26 20:51:37 [INFO] uvicorn | Application startup complete.
02-26 20:51:56 [INFO] uvicorn | ('127.0.0.1', 49351) - "WebSocket /cqhttp/ws" [accepted]
02-26 20:51:56 [INFO] nonebot | WebSocket Connection from CQHTTP Bot 340467 Accepted!
02-26 20:52:06 [INFO] nonebot | CQHTTP 3403467 | [message.group.normal]: Message 243350655 from 28*****647@[群:104*******472] "添加订阅"
02-26 20:52:06 [DEBUG] nonebot | Checking for matchers in priority 1...
02-26 20:52:06 [DEBUG] nonebot | Checking for matchers in priority 5...
from nonebot-bison.
另外,prts-forward-bot那边尝试运行也卡住了,我在那边提交了Issues
from nonebot-bison.
需要添加一个环境变量COMMAND_START=[""]
,你是用的插件模式不是直接克隆吧
from nonebot-bison.
感谢,直接克隆运行成功了,只是每给一条消息就会报个错,订阅看起来是正常的。
02-26 21:03:46 [INFO] nonebot_plugin_apscheduler | Scheduler Started
02-26 21:03:46 [INFO] uvicorn | Application startup complete.
02-26 21:03:46 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
02-26 21:04:10 [INFO] uvicorn | ('127.0.0.1', 49334) - "WebSocket /cqhttp/ws" [accepted]
02-26 21:04:10 [INFO] nonebot | WebSocket Connection from CQHTTP Bot 340467 Accepted!
02-26 21:04:17 [INFO] nonebot | CQHTTP 3403467 | [message.group.normal]: Message -1863996964 from 28447@[群:104***472] "添加订阅"
02-26 21:04:17 [INFO] nonebot | Event will be handled by <Matcher from hk_reporter, type=message, priority=5, temp=False
02-26 21:04:17 [ERROR] nonebot | Failed to handle event. Raw: {'anonymous': None, 'font': 0, 'group_id': 104472, 'me
ssage': [{'data': {'text': '请输入想要订阅的平台,目前支持:bilibili, weibo, rss'}, 'type': 'text'}], 'message_id': -404
580022, 'message_seq': 245, 'message_type': 'group', 'post_type': 'message_sent', 'raw_message': '请输入想要订阅的平台,
目前支持:bilibili, weibo, rss', 'self_id': 34********467, 'sender': {'age': 0, 'area': '', 'card': '', 'level': '', 'nickn
ame': 'PRTS Message', 'role': 'member', 'sex': 'unknown', 'title': '', 'user_id': 367}, 'sub_type': 'normal', 'ti
me': 1614344657, 'user_id': 340******7}
Traceback (most recent call last):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts\nb.exe_main.py", line 7, in
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 829, in c
all
return self.main(*args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 782, in mai
n
rv = self.invoke(ctx)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1259, in in
voke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1066, in in
voke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 610, in inv
oke
return callback(*args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nb_cli_init.py", line 46, in
run
run_bot(file, app)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nb_cli\handlers.py", line 52, in
run_bot
nonebot.run(app=f"{module_name}:{app}")
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nonebot_init.py", line 219,
in run
get_driver().run(host, port, *args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nonebot\drivers\fastapi.py", lin
e 160, in run
uvicorn.run(app or self.server_app,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\uvicorn\main.py", line 362, in r
un
server.run()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\uvicorn\main.py", line 390, in r
un
loop.run_until_complete(self.serve(sockets=sockets))
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 629, in run_unti
l_complete
self.run_forever()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 596, in run_fore
ver
self._run_once()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 1890, in _run_on
ce
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\programs\python\python39\lib\site-packages\nonebot\adapters\cqhttp\bot.py",
line 318, in handle_message
event = Event.parse_obj(message)
File "pydantic\main.py", line 520, in pydantic.main.BaseModel.parse_obj
return cls(**obj)
File "pydantic\main.py", line 362, in pydantic.main.BaseModel.init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for Event
post_type
unexpected value; permitted: 'message', 'notice', 'request', 'meta_event' (type=value_error.const; given=message_sent;
permitted=('message', 'notice', 'request', 'meta_event'))
02-26 21:04:17 [INFO] nonebot | Matcher <Matcher from hk_reporter, type=message, priority=5, temp=False> running complet
e
from nonebot-bison.
你用的nonebot版本是多少
from nonebot-bison.
v2.0.0a10
我的账号刚刚被封了,是被风控了嘛,我还没开那个文字转图像,在群里就发了一个测试消息
现在在下载Chromium,好慢
from nonebot-bison.
最新版优化了chromium下载速度,号建议挂7天不然会被风控
from nonebot-bison.
B站测试发现推送不出来
02-27 01:21:11 [INFO] hk_reporter | fetch new post from bilibili 481562758: 496161760276901052
02-27 01:21:11 [ERROR] apscheduler | Job "bilibili_check (trigger: interval[0:00:10], next run at: 2021-02-27 01:21:21 C
ST)" raised an exception
Traceback (most recent call last):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts\nb.exe_main.py", line 7, in
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 829, in c
all
return self.main(*args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 782, in mai
n
rv = self.invoke(ctx)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1259, in in
voke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1066, in in
voke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 610, in inv
oke
return callback(*args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nb_cli_init.py", line 46, in
run
run_bot(file, app)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nb_cli\handlers.py", line 52, in
run_bot
nonebot.run(app=f"{module_name}:{app}")
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nonebot_init.py", line 219,
in run
get_driver().run(host, port, *args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\nonebot\drivers\fastapi.py", lin
e 160, in run
uvicorn.run(app or self.server_app,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\uvicorn\main.py", line 362, in r
un
server.run()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\uvicorn\main.py", line 390, in r
un
loop.run_until_complete(self.serve(sockets=sockets))
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 629, in run_unti
l_complete
self.run_forever()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 596, in run_fore
ver
self._run_once()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 1890, in _run_on
ce
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\programs\python\python39\lib\site-packages\apscheduler\executors\base_py3.p
y", line 30, in run_coroutine_job
retval = await job.func(*job.args, **job.kwargs)
File "src/plugins\hk_reporter\scheduler.py", line 14, in bilibili_check
await fetch_and_send('bilibili')
File "src/plugins\hk_reporter\platform\utils.py", line 38, in fetch_and_send
send_msgs(bot, user.user, user.user_type, await send_post.generate_messages())
File "src/plugins\hk_reporter\post.py", line 77, in generate_messages
msgs.append(await parse_text(text))
File "src/plugins\hk_reporter\utils.py", line 67, in parse_text
return await r.text_to_pic_cqcode(text)
File "src/plugins\hk_reporter\utils.py", line 58, in text_to_pic_cqcode
data = await self.text_to_pic(text)
File "src/plugins\hk_reporter\utils.py", line 51, in text_to_pic
with open('/tmp/text-{}.html'.format(hash_text), 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/text-66e56bdeaf2f922a5058.html'
from nonebot-bison.
最新版已修复
from nonebot-bison.
Related Issues (20)
- BISON_OUTER_URL的配置文档不明确 HOT 18
- 抓到动态后无法向cq-http推送内容 HOT 3
- Bison 重构计划备忘 HOT 3
- 日志中微博经常报错 ApiError 希望能处理这种错误
- 微博也许需要支持登陆模块 HOT 10
- 长微博推送时微博内容不全 HOT 4
- bot对bilibili的up的新视频推送展示效果不好 HOT 2
- 提案:传送带(Conveyor)与包裹(Parcel) HOT 2
- 后台整体重构 HOT 1
- 0.9.0docker-compose部署报错:'allow_population_by_field_name' has been renamed to 'populate_by_name' HOT 5
- docker-compose文件少了/,文档内似乎也没有 HOT 1
- 重命名计划
- 希望添加qq频道支持 HOT 1
- b站订阅失效 HOT 8
- 在订阅了已弃用的 Platform 的群里查询订阅会导致报错
- 指定主题渲染失败 HOT 1
- 微博订阅:关注的人转发带图片的原文,结果不会发送原文的图片
- rss订阅:P标签不会单行显示
- 新版本提示AttributeError: ("'NoneType' object has no attribute 'get_live_action'", []) HOT 7
- [Feature Request]添加停止整个平台或者某个Target蹲饼的命令
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nonebot-bison.