mirror of https://github.com/Nofated095/Q2TG.git
feat: 创建群组后自动关闭【添加成员】快捷条
This commit is contained in:
parent
ceddf86453
commit
f71b04c62b
|
@ -103,4 +103,12 @@ export default class TelegramChat {
|
|||
console.log(links);
|
||||
return links.invites[0];
|
||||
}
|
||||
|
||||
public async hidePeerSettingsBar() {
|
||||
return await this.client.invoke(
|
||||
new Api.messages.HidePeerSettingsBar({
|
||||
peer: this.entity,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,6 +137,18 @@ export default class ConfigService {
|
|||
await chat.editAdmin(this.tgBot.me.username, true);
|
||||
const chatForBot = await this.tgBot.getChat(chat.id);
|
||||
|
||||
// 添加到 Filter
|
||||
await status.edit({ text: '正在将群添加到文件夹…' });
|
||||
this.filter.includePeers.push(utils.getInputPeer(chat));
|
||||
await this.tgUser.updateDialogFilter({
|
||||
id: this.filter.id,
|
||||
filter: this.filter,
|
||||
});
|
||||
|
||||
// 关闭【添加成员】快捷条
|
||||
await status.edit({ text: '正在关闭【添加成员】快捷条…' });
|
||||
await chat.hidePeerSettingsBar();
|
||||
|
||||
// 关联写入数据库
|
||||
await status.edit({ text: '正在写数据库…' });
|
||||
const dbPair = await forwardPairs.add(qEntity, chatForBot);
|
||||
|
@ -151,14 +163,6 @@ export default class ConfigService {
|
|||
data: { forwardPairId: dbPair.id, hash: avatarHash },
|
||||
});
|
||||
|
||||
// 添加到 Filter
|
||||
await status.edit({ text: '正在将群添加到文件夹…' });
|
||||
this.filter.includePeers.push(utils.getInputPeer(chat));
|
||||
await this.tgUser.updateDialogFilter({
|
||||
id: this.filter.id,
|
||||
filter: this.filter,
|
||||
});
|
||||
|
||||
// 更新关于文本
|
||||
await status.edit({ text: '正在更新关于文本…' });
|
||||
await chatForBot.editAbout(await this.getAboutText(qEntity));
|
||||
|
|
Loading…
Reference in New Issue