forked from bot/app
✨ 新增on_keywords
This commit is contained in:
@ -41,6 +41,4 @@ async def _(bot: Bot, event: MessageEvent):
|
||||
@shared_memory.on_subscriber_receive("event_to_nonebot")
|
||||
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")
|
35
src/nonebot_plugins/ts_chan_sub.py
Normal file
35
src/nonebot_plugins/ts_chan_sub.py
Normal file
@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
||||
|
||||
@Time : 2024/8/22 上午8:39
|
||||
@Author : snowykami
|
||||
@Email : snowykami@outlook.com
|
||||
@File : ts_chan_sub.py
|
||||
@Software: PyCharm
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
from liteyuki.comm import Channel, get_channel
|
||||
from nonebot import get_bot
|
||||
from nonebot.adapters.onebot.v11 import Bot
|
||||
chan_main = get_channel("chan-main")
|
||||
|
||||
|
||||
# @chan_main.on_receive()
|
||||
# async def _(data: str):
|
||||
# print("Received data from chan-main:", data)
|
||||
# try:
|
||||
# bot: Bot = get_bot("2443429204") # type: ignore
|
||||
#
|
||||
# def send_msg():
|
||||
#
|
||||
# bot.send_msg(message_type="private", user_id=2443429204, message=data)
|
||||
#
|
||||
# print("tsA")
|
||||
# print("tsA1")
|
||||
# await asyncio.ensure_future(c)
|
||||
# print("tsB")
|
||||
# except Exception as e:
|
||||
# print(e)
|
||||
# pass
|
Reference in New Issue
Block a user