perf: 在选择界面中隐藏已经创建了关联的群或好友

This commit is contained in:
Clansty 2022-03-02 21:40:08 +08:00
parent a28fe3e18c
commit 069b72491f
No known key found for this signature in database
GPG Key ID: 05F8479BA63A8E92
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,8 @@ export default class ConfigService {
// 开始添加转发群组流程
public async addGroup() {
const qGroups = Array.from(this.oicq.gl).map(e => e[1]);
const qGroups = Array.from(this.oicq.gl).map(e => e[1])
.filter(it => !forwardPairs.find(-it.group_id));
const buttons = qGroups.map(e =>
config.workMode === 'personal' ?
[Button.inline(
@ -81,6 +82,7 @@ export default class ConfigService {
}
private async openFriendSelection(clazz: FriendInfo[], name: string) {
clazz = clazz.filter(them => !forwardPairs.find(them.user_id));
await (await this.owner).createPaginatedInlineSelector(`选择 QQ 好友\n分组${name}`, clazz.map(e => [
Button.inline(`${e.remark || e.nickname} (${e.user_id})`, this.tgBot.registerCallback(
() => this.createGroupAndLink(e.user_id, e.remark || e.nickname),