Commit 9947a8b1 authored by mrhso's avatar mrhso

Merge branch 'master' into Sauketu

parents d4dd8376 a8c0f98a
......@@ -629,7 +629,7 @@ class QQBot extends EventEmitter {
let command = frames[0];
// 除錯用
this.emit('Raw', msg.toString());
// this.emit('Raw', msg.toString());
let msgdata;
let file;
......@@ -684,6 +684,7 @@ class QQBot extends EventEmitter {
userinfo = {
qq: 80000000,
name: '匿名消息',
rawGroupCard: nick,
groupCard: nick,
anonymous: frames[7],
};
......@@ -691,6 +692,17 @@ class QQBot extends EventEmitter {
if (this._isAirA) {
msgdata = parseMessage(msgdata.raw.substring(`[${userinfo.groupCard}]:`.length));
}
// 應用消息
} else if (parseInt(frames[2]) === 1000000) {
userinfo = {
qq: 1000000,
name: '应用消息',
// QQ 本身的 Nick 為「应用消息」,但群內消息記錄顯示為「系统消息」,故判定名片為「系统消息」
// 這是在找藉口嗎 www
// 不過確實比較迷啊,到底是應用還是系統,沒有人知道
rawGroupCard: '系统消息',
groupCard: '系统消息',
};
}
this.emit('GroupMessage', {
......
......@@ -57,11 +57,8 @@ class QQMessageHandler extends MessageHandler {
_rawdata: rawdata,
});
if (rawdata.from === 1000000) {
context.nick = '应用消息';
} else if (rawdata.from === 80000000) {
context.nick = '匿名消息';
context.text = `[${rawdata.user.groupCard}] ${context.text}`;
if (rawdata.from === 80000000) {
context.nick = `<匿名消息> ${rawdata.user.groupCard}`;
}
// 記錄圖片和語音
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment