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

Function blockUser

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

Source from the content-addressed store, hash-verified

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}`);
435 } catch (e) { log(LogLevel.ERROR, `block failed ${userId}`, e); }
436}
437
438async function deleteHistory(client: TelegramClient, userId: number) {
439 try {
440 const peer = await client.getInputEntity(userId);
441 await client.invoke(new Api.messages.DeleteHistory({ peer, revoke: false, maxId: 0 }));
442 log(LogLevel.INFO, `Deleted history ${userId}`);

Callers 1

runFailActionsFunction · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected