mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-11 04:07:23 +08:00
🔥 移除通道的部分特性
This commit is contained in:
parent
9ed4c1abb1
commit
a3a31a2c94
3
.gitignore
vendored
3
.gitignore
vendored
@ -53,4 +53,5 @@ dist
|
||||
|
||||
doc
|
||||
|
||||
mkdoc2.py
|
||||
mkdoc2.py
|
||||
result.json
|
@ -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
|
||||
|
@ -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")
|
Loading…
Reference in New Issue
Block a user