feat: 新增 /拍一拍 功能 + 斜杠命令菜单
- 输入框输入 / 弹出命令菜单,当前支持 /拍一拍 - 选择对象后输入 /拍一拍 发送拍一拍通知 - 所有在线用户屏幕抖动 + 正常聊天样式显示消息 - 命令注册表可扩展,后续新增命令只需 push 到数组
This commit is contained in:
@@ -177,6 +177,18 @@ async function sendMessage(e) {
|
||||
const composerState = collectChatComposerState();
|
||||
const { contentInput, submitBtn, content, contentRaw, selectedImage, toUser } = composerState;
|
||||
|
||||
// 拦截 /拍一拍 命令:使用当前选中的聊天对象
|
||||
if (content && typeof window.isPatCommand === "function" && window.isPatCommand(content)) {
|
||||
if (state) {
|
||||
state.isSending = false;
|
||||
state.sendStartedAt = 0;
|
||||
}
|
||||
if (typeof window.executePat === "function") {
|
||||
await window.executePat();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!content && !selectedImage) {
|
||||
contentInput?.focus();
|
||||
if (state) {
|
||||
|
||||
Reference in New Issue
Block a user