mirror of https://github.com/Nofated095/Q2TG.git
feat: 显示匿名消息发送者名称
This commit is contained in:
parent
069b72491f
commit
a39a7b43d2
|
@ -271,7 +271,7 @@ export default class ConfigService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getAboutText(entity: Friend | Group) {
|
private async getAboutText(entity: Friend | Group) {
|
||||||
let text = '';
|
let text: string;
|
||||||
if (entity instanceof Friend) {
|
if (entity instanceof Friend) {
|
||||||
text = `备注:${entity.remark}\n` +
|
text = `备注:${entity.remark}\n` +
|
||||||
`昵称:${entity.nickname}\n` +
|
`昵称:${entity.nickname}\n` +
|
||||||
|
|
|
@ -36,7 +36,10 @@ export default class ForwardService {
|
||||||
let messageHeader = '';
|
let messageHeader = '';
|
||||||
if (event.message_type === 'group') {
|
if (event.message_type === 'group') {
|
||||||
// 产生头部,这和工作模式没有关系
|
// 产生头部,这和工作模式没有关系
|
||||||
const sender = event.sender.card || event.sender.nickname;
|
let sender = event.sender.card || event.sender.nickname;
|
||||||
|
if(event.anonymous){
|
||||||
|
sender = `[${sender}]${event.anonymous.name}`
|
||||||
|
}
|
||||||
messageHeader = `<b>${helper.htmlEscape(sender)}</b>: `;
|
messageHeader = `<b>${helper.htmlEscape(sender)}</b>: `;
|
||||||
}
|
}
|
||||||
for (const elem of event.message) {
|
for (const elem of event.message) {
|
||||||
|
|
Loading…
Reference in New Issue