nek0us / nonebot-plugin-twitter Goto Github PK
View Code? Open in Web Editor NEW订阅推文推送
License: MIT License
订阅推文推送
License: MIT License
1.关于头像如果可以获取推特用户的头像体验会更好
2.在最后一句发送推特的发布时间
11-06 20:10:50 [ERROR] nonebot | Failed to import "nonebot_plugin_twitter"
Traceback (most recent call last):
File "", line 14, in
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot\plugin\load.py", line 130,
in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot\plugin\load.py", line 64,
in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot\plugin\manager.py", line 1
76, in load_all_plugins
return set(
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot\plugin\manager.py", line 1
77, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot\plugin\manager.py", line 1
42, in load_plugin
module = importlib.import_module(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_m
odule
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in find_and_load_unlocked
File "", line 688, in load_unlocked
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot\plugin\manager.py", line 2
42, in exec_module
super().exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\nonebot_plugin_twitter_init.py
", line 51, in
with Client(proxies=config_dev.twitter_proxy,http2=True) as client:
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\httpx_client.py", line 682, in __
init
self._mounts: typing.Dict[URLPattern, typing.Optional[BaseTransport]] = {
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\httpx_client.py", line 685, in
else self._init_proxy_transport(
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\httpx_client.py", line 739, in _i
nit_proxy_transport
return HTTPTransport(
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\Ava.venv\lib\site-packages\httpx_transports\default.py", lin
e 149, in init
self._pool = httpcore.HTTPProxy(
TypeError: HTTPProxy.init() got an unexpected keyword argument 'proxy_ssl_context'
06-26 16:25:07 [SUCCESS] nonebot | OneBot V11 2422576927 | [message.private.friend]: Message 986679002 from 2769384790 "关注推主 MiyU"
06-26 16:25:15 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_twitter)
06-26 16:25:15 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_twitter) running complete
06-26 16:25:15 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_twitter) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_transports\default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpcore_async\connection_pool.py", line 208, in handle_async_request
raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Bot\Nonebot\LittlePaimon\bot.py", line 37, in
nonebot.run(app="mp_main:app", access_log=False)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot_init_.py", line 309, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\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 629, 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 596, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, 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\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher
await _run_matcher(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 419, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\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\Python39\lib\site-packages\nonebot_plugin_twitter_init_.py", line 196, in save_handle
user_info = await get_user_info(data[0])
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot_plugin_twitter\api.py", line 17, in get_user_info
res = await client.get(url=f"{config_dev.twitter_url}/{user_name}")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_client.py", line 1757, in get
return await self.request(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_client.py", line 1620, in send
response = await self._send_handling_auth(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_client.py", line 1648, in _send_handling_auth
response = await self._send_handling_redirects(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_transports\default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 137, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
在群聊中at机器人尝试关注推主时报错,提示被风控。
08-15 17:53:06 [SUCCESS] nonebot | OneBot V11 1570175409 | [message.group.normal]: Message xxxxxxxx from xxxxxxxxx@[群:xxxxxxxx] '/关注推主 xxxxxxxx'
08-15 17:53:06 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_twitter)
08-15 17:53:12 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_twitter) running complete
08-15 17:53:12 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_twitter) failed.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/usr/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/usr/local/lib/python3.10/dist-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/dist-packages/nonebot/message.py", line 467, in check_and_run_matcher
await _run_matcher(
> File "/usr/local/lib/python3.10/dist-packages/nonebot/message.py", line 419, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/dist-packages/nonebot/internal/matcher/matcher.py", line 759, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/dist-packages/nonebot/internal/matcher/matcher.py", line 734, in simple_run
await handler(
File "/usr/local/lib/python3.10/dist-packages/nonebot/dependencies/__init__.py", line 108, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/usr/local/lib/python3.10/dist-packages/nonebot_plugin_twitter/__init__.py", line 212, in save_handle
await matcher.finish(f"未找到 {data[0]}")
File "/usr/local/lib/python3.10/dist-packages/nonebot/internal/matcher/matcher.py", line 483, in finish
await cls.send(message, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/nonebot/internal/matcher/matcher.py", line 467, in send
return await bot.send(event=event, message=_message, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/onebot/v11/bot.py", line 221, in send
return await self.__class__.send_handler(self, event, message, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/onebot/v11/bot.py", line 174, in send
return await bot.send_msg(**params)
File "/usr/local/lib/python3.10/dist-packages/nonebot/internal/adapter/bot.py", line 120, in call_api
raise exception
File "/usr/local/lib/python3.10/dist-packages/nonebot/internal/adapter/bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "/usr/local/lib/python3.10/dist-packages/nonebot/adapters/onebot/v11/adapter.py", line 143, in _call_api
return handle_api_result(await self._result_store.fetch(seq, timeout))
File "/usr/local/lib/python3.10/dist-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='1', message='send group message failed: blocked by server', msg='SEND_MSG_API_ERROR', retcode=100, status='failed', wording='send group message failed: blocked by server')
此外,私聊时似乎不管是否搜索到用户都会回复查无此人。
06-13 23:28:59 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_twitter) failed. Traceback (most recent call last): File "", line 15, in File "/root/df/.venv/lib/python3.10/site-packages/nonebot/init.py", line 309, in run get_driver().run(*args, **kwargs) File "/root/df/.venv/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 198, in run uvicorn.run( File "/root/df/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 578, in run server.run() File "/root/df/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/df/.venv/lib/python3.10/site-packages/nonebot/message.py", line 467, in check_and_run_matcher await _run_matcher( > File "/root/df/.venv/lib/python3.10/site-packages/nonebot/message.py", line 419, in run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/df/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 753, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/df/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 728, in simple_run await handler( File "/root/df/.venv/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "/root/df/.venv/lib/python3.10/site-packages/nonebot_plugin_twitter/init.py", line 196, in save_handle user_info = await get_user_info(data[0]) File "/root/df/.venv/lib/python3.10/site-packages/nonebot_plugin_twitter/api.py", line 23, in get_user_info result["screen_name"] = soup.find_all('a', class='profile-card-fullname')[0].next IndexError: list index out of range
根据媒体设置,群XXXXXXX 的推文 XXXXXXXXX 跳过发送
开启了群里也开启了推文推送,但是后台还是会提示这个
JSON文件中也都是true {"status": true, "r18": true, "media": true}}
06-12 12:07:11 [ERROR] nonebot | Failed to import "nonebot_plugin_twitter"
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1\bot.py", line 14, in
nonebot.load_from_toml("pyproject.toml")
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\plugin\load.py", line 125,
in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\plugin\load.py", line 62,
in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\plugin\manager.py", line 1
75, in load_all_plugins
return set(
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\plugin\manager.py", line 1
76, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\plugin\manager.py", line 1
41, in load_plugin
module = importlib.import_module(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_m
odule
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot\plugin\manager.py", line 2
40, in exec_module
super().exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Administrator\Desktop\ChatGPT3.5\nonebot\No1.venv\lib\site-packages\nonebot_plugin_twitter_init.py
", line 22, in
plugin_meta = PluginMetadata(
TypeError: PluginMetadata.init() got an unexpected keyword argument 'type'
报错日志如上 不是很懂怎么解决 求大佬解惑
先等待上游更新,不行等有空了我再尝试其他方案
08-11 20:27:51 [ERROR] nonebot | Failed to import "nonebot_plugin_twitter"
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\zhunxunbot\zhenxun_bot\bot.py", line 22, in
nonebot.load_plugins("addtional_plugin/nonebot-plugin-twitter")
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-7qRsZznG-py3.9\lib\site-packages\nonebot\plugin\load.py", line 50, in load_plugins
return manager.load_all_plugins()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-7qRsZznG-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 176, in load_all_plugins
return set(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-7qRsZznG-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 177, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-7qRsZznG-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 146, in load_plugin
module = importlib.import_module(
File "C:\Python\lib\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 "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-7qRsZznG-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 242, in exec_module
super().exec_module(module)
File "", line 850, in exec_module
File "", line 228, in call_with_frames_removed
File "C:\Users\Administrator\Desktop\zhunxunbot\zhenxun_bot\addtional_plugin\nonebot-plugin-twitter\nonebot_plugin_twitter_init.py", line 17, in
from nonebot_plugin_sendmsg_by_bots import tools
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-7qRsZznG-py3.9\lib\site-packages\nonebot_plugin_sendmsg_by_bots\tools.py", line 42, in
async def send_group_msg_by_bots(group_id:int,msg:Message|MessageSegment|str) -> bool:
TypeError: unsupported operand type(s) for |: 'ABCMeta' and 'ABCMeta'
恳请大佬指教,已填写
twitter_proxy
twitter_qq
command_priority
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.