MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / muteChat

Function muteChat

pmcaptcha/pmcaptcha.ts:423–431  ·  view source on GitHub ↗
(client: TelegramClient, userId: number)

Source from the content-addressed store, hash-verified

421 try {
422 const peer = await client.getInputEntity(userId);
423 await client.invoke(new Api.account.UpdateNotifySettings({
424 peer: new Api.InputNotifyPeer({ peer }),
425 settings: new Api.InputPeerNotifySettings({ muteUntil: 2147483647, showPreviews: false, silent: true })
426 }));
427 } catch (e) { log(LogLevel.ERROR, `mute failed ${userId}`, e); }
428}
429
430async function blockUser(client: TelegramClient, userId: number) {
431 try {
432 const peer = await client.getInputEntity(userId);
433 await client.invoke(new Api.contacts.Block({ id: peer }));
434 log(LogLevel.INFO, `Blocked ${userId}`);

Callers 3

runFailActionsFunction · 0.85
executeBlockActionsFunction · 0.85
messageListenerFunction · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected