1
0
forked from bot/app

🔥 移除通道的部分特性

This commit is contained in:
远野千束 2024-08-22 07:23:44 +08:00
parent 9ed4c1abb1
commit a3a31a2c94
3 changed files with 7 additions and 12 deletions

3
.gitignore vendored
View File

@ -53,4 +53,5 @@ dist
doc
mkdoc2.py
mkdoc2.py
result.json

View File

@ -217,16 +217,6 @@ class Channel(Generic[T]):
data = self.conn_recv.recv()
self._run_on_sub_receive_funcs(data)
def __iter__(self):
return self
def __next__(self) -> Any:
return self.receive()
def __del__(self):
self.close()
logger.debug(f"Channel {self.name} deleted.")
"""子进程可用的主动和被动通道"""
active_channel: Optional["Channel"] = None

View File

@ -8,6 +8,8 @@ Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
@File : to_liteyuki.py
@Software: PyCharm
"""
import asyncio
from nonebot import Bot, get_bot, on_message
from nonebot.plugin import PluginMetadata
from nonebot.adapters.onebot.v11 import MessageEvent, Bot
@ -37,6 +39,8 @@ async def _(bot: Bot, event: MessageEvent):
@shared_memory.on_subscriber_receive("event_to_nonebot")
async def _(event: MessageEvent):
async def _(event: LiteyukiMessageEvent):
bot: Bot = get_bot(event.bot_id)
print("A")
await bot.send_msg(message_type=event.message_type, user_id=int(event.session_id), group_id=int(event.session_id), message=event.data["message"])
print("B")