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

Method listJobs

tmp_admin/tmp_admin.ts:881–902  ·  view source on GitHub ↗
(
    msg: Api.Message,
    trigger: Api.Message | undefined,
    chatKey: string
  )

Source from the content-addressed store, hash-verified

879 const jobs = [...this.jobs.values()].filter((job) => job.chatKey === chatKey);
880 if (jobs.length === 0) {
881 await respondToCommand(msg, trigger, { text: "当前没有等待自动解除的临时管理员" });
882 return;
883 }
884
885 const now = Date.now();
886 const lines = jobs.map((job) => {
887 const remainingMinutes = Math.max(0, Math.ceil((job.expiresAt - now) / 60_000));
888 return `- ${job.userDisplay} | 剩余 ${codeTag(`${remainingMinutes} 分钟`)}`;
889 });
890
891 await respondToCommand(msg, trigger, {
892 text: `当前临时管理员:\n${lines.join("\n")}`,
893 parseMode: "html",
894 });
895 }
896
897 private async getCurrentParticipantOrThrow(
898 channel: any,
899 targetEntity: any
900 ): Promise<any> {
901 const client = await getGlobalClient();
902 const info = await client.invoke(
903 new Api.channels.GetParticipant({
904 channel,
905 participant: targetEntity,

Callers 1

TmpAdminPluginClass · 0.95

Calls 2

respondToCommandFunction · 0.85
codeTagFunction · 0.70

Tested by

no test coverage detected