mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-22 20:17:39 +08:00
🔥 移除通道的部分特性
This commit is contained in:
parent
9ed4c1abb1
commit
a3a31a2c94
1
.gitignore
vendored
1
.gitignore
vendored
@ -54,3 +54,4 @@ dist
|
|||||||
doc
|
doc
|
||||||
|
|
||||||
mkdoc2.py
|
mkdoc2.py
|
||||||
|
result.json
|
@ -217,16 +217,6 @@ class Channel(Generic[T]):
|
|||||||
data = self.conn_recv.recv()
|
data = self.conn_recv.recv()
|
||||||
self._run_on_sub_receive_funcs(data)
|
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
|
active_channel: Optional["Channel"] = None
|
||||||
|
@ -8,6 +8,8 @@ Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
|||||||
@File : to_liteyuki.py
|
@File : to_liteyuki.py
|
||||||
@Software: PyCharm
|
@Software: PyCharm
|
||||||
"""
|
"""
|
||||||
|
import asyncio
|
||||||
|
|
||||||
from nonebot import Bot, get_bot, on_message
|
from nonebot import Bot, get_bot, on_message
|
||||||
from nonebot.plugin import PluginMetadata
|
from nonebot.plugin import PluginMetadata
|
||||||
from nonebot.adapters.onebot.v11 import MessageEvent, Bot
|
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")
|
@shared_memory.on_subscriber_receive("event_to_nonebot")
|
||||||
async def _(event: MessageEvent):
|
async def _(event: LiteyukiMessageEvent):
|
||||||
bot: Bot = get_bot(event.bot_id)
|
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"])
|
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