Compare commits

...

2 Commits

Author SHA1 Message Date
Nofated095 2ed24c5579 fix userMe in ForwardService 2024-01-31 21:53:29 +08:00
Nofated095 575f3284b0 fix tgUser in AliveCheckController 2024-01-31 21:41:13 +08:00
2 changed files with 0 additions and 20 deletions

View File

@ -6,7 +6,6 @@ import { Api } from 'telegram';
export default class AliveCheckController {
constructor(private readonly instance: Instance,
private readonly tgBot: Telegram,
private readonly tgUser: Telegram,
private readonly oicq: OicqClient) {
tgBot.addNewMessageEventHandler(this.handleMessage);
}
@ -33,20 +32,6 @@ export default class AliveCheckController {
for (const instance of instances) {
const oicq = instance.oicq;
const tgBot = instance.tgBot;
const tgUser = instance.tgUser;
const tgUserName = (tgUser.me.username || tgUser.me.usernames.length) ?
'@' + (tgUser.me.username || tgUser.me.usernames[0].username) : tgUser.me.firstName;
messageParts.push([
`Instance #${instance.id}`,
`QQ <code>${instance.qqUin}</code>\t` +
`${boolToStr(oicq.isOnline())}\t${oicq.stat.msg_cnt_per_min} msg/min`,
`TG @${tgBot.me.username}\t${boolToStr(tgBot.isOnline)}`,
`TG User ${tgUserName}\t${boolToStr(tgBot.isOnline)}`,
].join('\n'));
}
return messageParts.join('\n\n');

View File

@ -365,11 +365,6 @@ export default class ForwardService {
}
}
if (this.instance.workMode === 'personal' && event.message_type === 'group' && event.atme && !replyTo) {
message += `\n<b>@${this.instance.userMe.usernames?.length ?
this.instance.userMe.usernames[0].username :
this.instance.userMe.username}</b>`;
}
// 发送消息
const messageToSend: SendMessageParams = {