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

Method unbanUser

aban/aban.ts:801–819  ·  view source on GitHub ↗
(
    client: TelegramClient,
    chatId: any,
    userId: number,
    participant?: any
  )

Source from the content-addressed store, hash-verified

799
800 static async getManagedGroups(
801 client: TelegramClient
802 ): Promise<ManagedGroup[]> {
803 // v5: 用 dialog.entity.creator/adminRights 本地过滤(零 RPC)。
804 // v4 对每群 GetParticipant,易假阴性 → refresh 统计为 0;空数组也会被当成有效缓存。
805 const cached = await this.cache.get("managed_groups_v5");
806 if (cached && Array.isArray(cached) && cached.length > 0) return cached;
807
808 const groups: ManagedGroup[] = [];
809
810 try {
811 const dialogs = await this.getAllManageableDialogs(client);
812
813 let skippedNoRights = 0;
814 for (const dialog of dialogs || []) {
815 if (!(dialog.isChannel || dialog.isGroup)) continue;
816 if (!this.dialogHasManageRights(dialog)) {
817 skippedNoRights++;
818 continue;
819 }
820 const isChannel = !(dialog.isGroup && !dialog.isChannel);
821 const rawHash = isChannel ? dialog.entity?.accessHash : undefined;
822 const accessHash = rawHash != null ? String(rawHash) : undefined;

Callers 2

kickUserMethod · 0.95
handleBasicCommandMethod · 0.80

Calls 3

resolveParticipantMethod · 0.95
applyBanLikeActionMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected