接口
信息
捕获事件后可进行的
useMessage
在响应事件(如消息被创建)时,发送消息。
src/response/**/*/res.ts
import { Text, useMessage } from 'alemonjs'
export const selects = onSelects(['message.create'])
export default onResponse(selects, (event, next) => {
// 创建
const [message] = useMessage(event)
message.send(format(Text('hello word !')))
})
src/response/**/*/res.ts
import { Text } from 'alemonjs'
export const selects = onSelects(['message.create'])
export default onResponse(selects, () => {
return {
// 即将要发送的数据
data: format(Text('hello word !'))
}
})