-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
语音频道退出时报错 #47
Comments
查了一下文档没有写这个 顺便一提,仓库的主人已经消失好一会儿了。 Log
|
了解了,谢谢说明 |
问一下大佬,网关的请求怎么发送,类似于使bot加入语音频道或者更改自身presence的方法,文档写的不是很明白 |
这个适配器好像没有实现发送 GateWay Event。 只定义了参数,没有实现发送接口。 Code
adapter-discord/nonebot/adapters/discord/api/model.py Lines 2418 to 2451 in 5794c0b
|
应该是这样,我翻遍了这个适配器没有找到类似的方法 |
那目前好像是只能等仓库主人更新了,自己实在是看不懂网关的操作 |
12-22 20:57:39 [WARNING] Hx.bot | Discord | Unknown payload type: VOICE_CHANNEL_STATUS_UPDATE, detail: Dispatch(opcode=<Opcode.DISPATCH: 0>, data={'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'}, sequence=190, type='VOICE_CHANNEL_STATUS_UPDATE')
12-22 20:57:39 [WARNING] Hx.bot | Discord | Failed to parse event Dispatch(opcode=<Opcode.DISPATCH: 0>, data={'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'}, sequence=190, type='VOICE_CHANNEL_STATUS_UPDATE')
Traceback (most recent call last):
File "c:\Users\mcxia\Desktop\hx_discord\bot.py", line 34, in
nonebot.run()
│ └ <function run at 0x04D83970>
└ <module 'nonebot' from 'C:\Users\mcxia\Desktop\hx_discord\.venv\lib\site-packages\nonebot\init.py'>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\nonebot_init_.py", line 337, in run
get_driver().run(*args, **kwargs)
│ │ └ {}
│ └ ()
└ <function get_driver at 0x04736418>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\nonebot\drivers\none.py", line 61, in run
anyio.run(self._serve)
│ │ │ └ <function Driver._serve at 0x09B036A0>
│ │ └ Driver(type='none+aiohttp', adapters=1, bots=1)
│ └ <function run at 0x04736580>
└ <module 'anyio' from 'C:\Users\mcxia\Desktop\幻歆的项目\hx_discord\.venv\lib\site-packages\anyio\init.py'>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\anyio_core_eventloop.py", line 74, in run
return async_backend.run(func, args, {}, backend_options)
│ │ │ │ └ {}
│ │ │ └ ()
│ │ └ <bound method Driver._serve of Driver(type='none+aiohttp', adapters=1, bots=1)>
│ └ <classmethod(<function AsyncIOBackend.run at 0x0ACAD610>)>
└ <class 'anyio._backends._asyncio.AsyncIOBackend'>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\anyio_backends_asyncio.py", line 2284, in run
return runner.run(wrapper())
│ │ └ <function Driver._serve at 0x08876610>
│ └ <function Runner.run at 0x0AC9C388>
└ <anyio._backends._asyncio.Runner object at 0x0A4B2FE8>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\anyio_backends_asyncio.py", line 210, in run
return self._loop.run_until_complete(task)
│ │ │ └ <Task pending name='nonebot.drivers.none.Driver._serve' coro=<Driver._serve() running at C:\Users\mcxia\Desktop\hx_disc...
│ │ └ <function BaseEventLoop.run_until_complete at 0x041D62B0>
│ └
└ <anyio._backends._asyncio.Runner object at 0x0A4B2FE8>
File "C:\Users\mcxia\AppData\Local\Programs\Python\Python310-32\lib\asyncio\base_events.py", line 633, in run_until_complete
self.run_forever()
│ └ <function ProactorEventLoop.run_forever at 0x0421BF10>
└
File "C:\Users\mcxia\AppData\Local\Programs\Python\Python310-32\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\mcxia\AppData\Local\Programs\Python\Python310-32\lib\asyncio\base_events.py", line 600, in run_forever
self._run_once()
│ └ <function BaseEventLoop._run_once at 0x041D7028>
└
File "C:\Users\mcxia\AppData\Local\Programs\Python\Python310-32\lib\asyncio\base_events.py", line 1896, in _run_once
handle._run()
│ └ <function Handle._run at 0x0418A580>
└ <Handle Task.task_wakeup()>
File "C:\Users\mcxia\AppData\Local\Programs\Python\Python310-32\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
│ │ │ │ │ └ <member '_args' of 'Handle' objects>
│ │ │ │ └ <Handle Task.task_wakeup()>
│ │ │ └ <member '_callback' of 'Handle' objects>
│ │ └ <Handle Task.task_wakeup()>
│ └ <member '_context' of 'Handle' objects>
└ <Handle Task.task_wakeup()>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\nonebot\adapters\discord\adapter.py", line 213, in _forward_ws
await self._loop(bot, ws)
│ │ │ └ WebSocket('wss://gateway-us-east1-b.discord.gg')
│ │ └ Bot(type='Discord', self_id='1307426419504189550')
│ └ <function Adapter._loop at 0x09B28B20>
└ Adapter(name='Discord')
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\nonebot\adapters\discord\adapter.py", line 445, in payload_to_event
event = type_validate_python(Event, payload.data)
│ │ │ └ {'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'}
│ │ └ Dispatch(opcode=<Opcode.DISPATCH: 0>, data={'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'}, ...
│ └ <class 'nonebot.adapters.discord.event.Event'>
└ <function type_validate_python at 0x047362F8>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\nonebot\compat.py", line 227, in type_validate_python
return TypeAdapter(type_).validate_python(data)
│ │ └ {'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'}
│ └ <class 'nonebot.adapters.discord.event.Event'>
└ <class 'pydantic.type_adapter.TypeAdapter'>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\pydantic\type_adapter.py", line 144, in wrapped
return func(self, *args, **kwargs)
│ │ │ └ {}
│ │ └ ({'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'},)
│ └ <pydantic.type_adapter.TypeAdapter object at 0x0AF32E38>
└ <function TypeAdapter.validate_python at 0x046D0730>
File "C:\Users\mcxia\Desktop\hx_discord.venv\lib\site-packages\pydantic\type_adapter.py", line 375, in validate_python
return self.validator.validate_python(object, strict=strict, from_attributes=from_attributes, context=context)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ None
│ │ │ │ └ None
│ │ │ └ {'status': None, 'id': '1302631813478613065', 'guild_id': '1302631810332889158'}
│ │ └ <method 'validate_python' of 'pydantic_core._pydantic_core.SchemaValidator' objects>
│ └ SchemaValidator(title="Event", validator=Model(
│ ModelValidator {
│ revalidate: Never,
│ validator: ModelField...
└ <pydantic.type_adapter.TypeAdapter object at 0x0AF32E38>
TypeError: Can't instantiate abstract class Event with abstract method get_type
The text was updated successfully, but these errors were encountered: