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

Function runFailActions

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

Source from the content-addressed store, hash-verified

476 log(LogLevel.INFO, `Deleted history ${userId}`);
477 } catch (e) { log(LogLevel.ERROR, `delete history failed ${userId}`, e); }
478}
479
480async function reportSpam(client: TelegramClient, userId: number) {
481 try {
482 const peer = await resolveInputPeer(client, userId);
483 await client.invoke(new Api.account.ReportPeer({
484 peer, reason: new Api.InputReportReasonSpam(), message: "spam"
485 }));
486 log(LogLevel.INFO, `Reported ${userId}`);
487 } catch (e) { log(LogLevel.ERROR, `report failed ${userId}`, e); }
488}
489
490async function unmuteChat(client: TelegramClient, userId: number) {
491 try {
492 const peer = await resolveInputPeer(client, userId);
493 await client.invoke(new Api.account.UpdateNotifySettings({
494 peer: new Api.InputNotifyPeer({ peer }),
495 settings: new Api.InputPeerNotifySettings({ muteUntil: 0, showPreviews: true, silent: false })
496 }));
497 } catch (e) { log(LogLevel.ERROR, `unmute failed ${userId}`, e); }
498}

Callers 2

sendCaptchaFunction · 0.85
handleReplyFunction · 0.85

Calls 5

archiveChatFunction · 0.85
muteChatFunction · 0.85
blockUserFunction · 0.85
logFunction · 0.85
reportSpamFunction · 0.85

Tested by

no test coverage detected