| 457 | await client.invoke(new Api.account.UpdateNotifySettings({ |
| 458 | peer: new Api.InputNotifyPeer({ peer }), |
| 459 | settings: new Api.InputPeerNotifySettings({ muteUntil: 2147483647, showPreviews: false, silent: true }) |
| 460 | })); |
| 461 | } catch (e) { log(LogLevel.ERROR, `mute failed ${userId}`, e); } |
| 462 | } |
| 463 | |
| 464 | async function blockUser(client: TelegramClient, userId: number) { |
| 465 | try { |
| 466 | const peer = await resolveInputPeer(client, userId); |
| 467 | await client.invoke(new Api.contacts.Block({ id: peer })); |
| 468 | log(LogLevel.INFO, `Blocked ${userId}`); |
| 469 | } catch (e) { log(LogLevel.ERROR, `block failed ${userId}`, e); } |
| 470 | } |