import{_ as i,o as a,c as e,a7 as t}from"./chunks/framework._avq4Ty7.js";const g=JSON.parse('{"title":"liteyuki.session.event","description":"","frontmatter":{"title":"liteyuki.session.event"},"headers":[],"relativePath":"dev/api/session/event.md","filePath":"zh/dev/api/session/event.md","lastUpdated":null}'),n={name:"dev/api/session/event.md"};function h(l,s,k,p,r,d){return a(),e("div",null,s[0]||(s[0]=[t(`

模块 liteyuki.session.event

Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/19 下午10:47 @Author : snowykami @Email : snowykami@outlook.com @File : event.py @Software: PyCharm

class MessageEvent


func __init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_type: str, raw_message: str, session_id: str, user_id: str, session_type: str, receive_channel: Optional[Channel[MessageEvent]] = None, data: Optional[dict[str, Any]] = None)

说明: 轻雪抽象消息事件

源代码在GitHub上查看
python
def __init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_type: str, raw_message: str, session_id: str, user_id: str, session_type: str, receive_channel: Optional[Channel['MessageEvent']]=None, data: Optional[dict[str, Any]]=None):
    if data is None:
        data = {}
    self.message_type = message_type
    self.data = data
    self.bot_id = bot_id
    self.message = message
    self.raw_message = raw_message
    self.session_id = session_id
    self.session_type = session_type
    self.user_id = user_id
    self.receive_channel = receive_channel

func reply(self, message: str | dict[str, Any])

说明: 回复消息

参数:

源代码在GitHub上查看
python
def reply(self, message: str | dict[str, Any]):
    reply_event = MessageEvent(message_type=self.session_type, message=message, raw_message='', data={'message': message}, bot_id=self.bot_id, session_id=self.session_id, user_id=self.user_id, session_type=self.session_type, receive_channel=None)
    if self.receive_channel:
        self.receive_channel.send(reply_event)
`,14)]))}const y=i(n,[["render",h]]);export{g as __pageData,y as default};