fywinds / gocqapi Goto Github PK
View Code? Open in Web Editor NEWgo-cqhttp API typing annoations, return data models and utils for nonebot
License: MIT License
go-cqhttp API typing annoations, return data models and utils for nonebot
License: MIT License
具体报错信息如下:
Traceback (most recent call last):
File "E:/python2/QQToVenir/demo.py", line 1, in <module>
from gocqapi import api
File "E:\pythonvenv\Nonebot\lib\site-packages\gocqapi\__init__.py", line 3, in <module>
from .info import InfoAPI
File "E:\pythonvenv\Nonebot\lib\site-packages\gocqapi\info.py", line 3, in <module>
from ._api import BaseAPI
File "E:\pythonvenv\Nonebot\lib\site-packages\gocqapi\_api.py", line 8, in <module>
class BaseAPI:
File "E:\pythonvenv\Nonebot\lib\site-packages\gocqapi\_api.py", line 16, in BaseAPI
async def call(self, api: str, **kwargs: Any) -> dict[Any, Any]:
TypeError: 'type' object is not subscriptable
报错代码:
from gocqapi import api
assert _bot is Bot
这个写法有点奇怪,这里想表达的是不是isinstance(bot, Bot)
复现代码:
msg_id = ...
api = API(bot.self_id)
await api.delete_msg(msg_id)
报错:
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 8, in <module>
sys.exit(run())
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 231, in run
super().run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 202, in run
self.manage_workers()
File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 551, in manage_workers
self.spawn_workers()
File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 622, in spawn_workers
self.spawn_worker()
File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.10/site-packages/uvicorn/workers.py", line 66, in init_process
super(UvicornWorker, self).init_process()
File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 142, in init_process
self.run()
File "/usr/local/lib/python3.10/site-packages/uvicorn/workers.py", line 98, in run
return asyncio.run(self._serve())
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 188, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run
await handler(
File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_revoke/__init__.py", line 21, in _
await api.delete_msg(reply_msg_id)
File "/usr/local/lib/python3.10/site-packages/gocqapi/message.py", line 159, in delete_msg
await self.call("delete_msg", message_id=message_id)
File "/usr/local/lib/python3.10/site-packages/gocqapi/_api.py", line 42, in call
raise e
File "/usr/local/lib/python3.10/site-packages/gocqapi/_api.py", line 36, in call
assert _bot is Bot
AssertionError
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.