import{_ as s,o as e,c as n,e as a}from"./app-D7T8XZRy.js";const t={},i=a(`

class MessageEvent

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: str, data: Optional[dict[str, Any]]) -> None

 轻雪抽象消息事件

Args:

bot_id: 机器人ID

message: 消息,消息段数组[{type: str, data: dict[str, Any]}]

raw_message: 原始消息(通常为纯文本的格式)

message_type: 消息类型(private, group, other)



session_id: 会话ID(私聊通常为用户ID,群聊通常为群ID)

session_type: 会话类型(private, group)

receive_channel: 接收频道(用于回复消息)



data: 附加数据
源代码
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: str, data: Optional[dict[str, Any]]=None):
    """
        轻雪抽象消息事件
        Args:

            bot_id: 机器人ID
            message: 消息,消息段数组[{type: str, data: dict[str, Any]}]
            raw_message: 原始消息(通常为纯文本的格式)
            message_type: 消息类型(private, group, other)

            session_id: 会话ID(私聊通常为用户ID,群聊通常为群ID)
            session_type: 会话类型(private, group)
            receive_channel: 接收频道(用于回复消息)

            data: 附加数据
        """
    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

def reply(self, message: str | dict[str, Any]) -> None

 回复消息

Args:

message:

Returns:

源代码
def reply(self, message: str | dict[str, Any]):
    """
        回复消息
        Args:
            message:
        Returns:
        """
    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, session_type=self.session_type, receive_channel='_')
    shared_memory.publish(self.receive_channel, reply_event)

var 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, session_type=self.session_type, receive_channel='_')

var data = {}

`,14),p=[i];function o(l,r){return e(),n("div",null,p)}const d=s(t,[["render",o],["__file","event.html.vue"]]),u=JSON.parse(`{"path":"/en/dev/api/message/event.html","title":"liteyuki.message.event","lang":"en-US","frontmatter":{"title":"liteyuki.message.event","order":1,"icon":"laptop-code","category":"API","description":"class MessageEvent 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, re...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/message/event.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/dev/api/message/event.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot"}],["meta",{"property":"og:title","content":"liteyuki.message.event"}],["meta",{"property":"og:description","content":"class MessageEvent 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, re..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-21T09:59:21.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-21T09:59:21.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.message.event\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-21T09:59:21.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":3,"title":"class MessageEvent","slug":"class-messageevent","link":"#class-messageevent","children":[]},{"level":3,"title":"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: str, data: Optional[dict[str, Any]]) -> None","slug":"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-str-data-optional-dict-str-any-none","link":"#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-str-data-optional-dict-str-any-none","children":[]},{"level":3,"title":"def reply(self, message: str | dict[str, Any]) -> None","slug":"def-reply-self-message-str-dict-str-any-none","link":"#def-reply-self-message-str-dict-str-any-none","children":[]},{"level":3,"title":"var 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, session_type=self.session_type, receive_channel='_')","slug":"var-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-session-type-self-session-type-receive-channel","link":"#var-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-session-type-self-session-type-receive-channel","children":[]},{"level":3,"title":"var data = {}","slug":"var-data","link":"#var-data","children":[]}],"git":{"createdTime":1724234361000,"updatedTime":1724234361000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":1}]},"readingTime":{"minutes":1.23,"words":369},"filePathRelative":"en/dev/api/message/event.md","localizedDate":"August 21, 2024","autoDesc":true}`);export{d as comp,u as data};