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

Function parseTrimArgs

admin_board/admin_board.ts:1021–1041  ·  view source on GitHub ↗
(remainder: string)

Source from the content-addressed store, hash-verified

1019 const firstToken = tokens[0] || "";
1020 if (!/^[1-9]\d*$/.test(firstToken)) {
1021 return {};
1022 }
1023
1024 const targetArg = tokens.slice(1).join(" ").trim();
1025 return {
1026 limit: Number(firstToken),
1027 targetArg: targetArg || undefined,
1028 };
1029}
1030
1031function isCreatorUser(user: Api.User): boolean {
1032 const participant = (user as any).participant;
1033 return (
1034 participant instanceof Api.ChatParticipantCreator ||
1035 participant instanceof Api.ChannelParticipantCreator
1036 );
1037}
1038
1039async function demoteAdminInTarget(
1040 target: TargetChat,
1041 user: Api.User,
1042): Promise<void> {
1043 const client = await getGlobalClient();
1044 if (!client) throw new Error("Telegram 客户端未初始化");

Callers 1

handleTrimActionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected