Giter VIP home page Giter VIP logo

gocqapi's Introduction

Hi 👋, I'm FYWinds

giphy

Profile Views

⚗️ Skills

Python TypeScript Java Kotlin Lua Markdown

📖 Learning

.Net C# Rust

🔭 Want to learn

Go Haskell HTML5 CSS3

💻

Windows 11 Windows Terminal PowerShell VS Code Insiders IntelliJ IDEA

gocqapi's People

Contributors

fywinds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

inease

gocqapi's Issues

引入时报错:TypeError

具体报错信息如下:

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

AssertionError: assert _bot is Bot

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.