mirror of https://github.com/Nofated095/Q2TG.git
feat: 默认解除私聊的静音
This commit is contained in:
parent
ffdfc90b96
commit
93113fe343
|
@ -115,4 +115,13 @@ export default class TelegramChat {
|
|||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public async setNotificationSettings(params: { showPreviews?: boolean, silent?: boolean, muteUntil?: number, sound?: string }) {
|
||||
return await this.client.invoke(
|
||||
new Api.account.UpdateNotifySettings({
|
||||
peer: new Api.InputNotifyPeer({ peer: this.inputPeer }),
|
||||
settings: new Api.InputPeerNotifySettings(params),
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,6 +149,12 @@ export default class ConfigService {
|
|||
status && await status.edit({ text: '正在关闭【添加成员】快捷条…' });
|
||||
await chat.hidePeerSettingsBar();
|
||||
|
||||
// 对于私聊,默认解除静音
|
||||
if (roomId > 0) {
|
||||
status && await status.edit({ text: '正在解除静音…' });
|
||||
await chat.setNotificationSettings({ silent: false, showPreviews: true });
|
||||
}
|
||||
|
||||
// 关联写入数据库
|
||||
status && await status.edit({ text: '正在写数据库…' });
|
||||
const dbPair = await forwardPairs.add(qEntity, chatForBot);
|
||||
|
|
Loading…
Reference in New Issue