Skip to content

Commit

Permalink
fix: 发表情触发 slash
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Jul 8, 2024
1 parent b349705 commit 308136d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions main/src/controllers/ForwardController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class ForwardController {
}

private onQqMessage = async (event: PrivateMessageEvent | GroupMessageEvent) => {
this.log.debug('收到 QQ 消息', event);
try {
const target = event.message_type === 'private' ? event.friend : event.group;
const pair = this.instance.forwardPairs.find(target);
Expand Down
1 change: 1 addition & 0 deletions main/src/controllers/HugController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class {
if (!pair) return;
if ((pair.flags | this.instance.flags) & flags.DISABLE_SLASH_COMMAND) return;
const chain = [...event.message];
if (chain.some(it => it.type === 'face')) return;
while (chain.length && chain[0].type !== 'text') {
chain.shift();
}
Expand Down

0 comments on commit 308136d

Please sign in to comment.