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

Function getCommandArgsText

quote/quote.ts:259–268  ·  view source on GitHub ↗
(msg: Api.Message, command: string)

Source from the content-addressed store, hash-verified

257
258function generateRandomColor(): string {
259 return `#${Math.floor(Math.random() * 0xffffff).toString(16).padStart(6, "0")}`;
260}
261
262function getCommandArgsText(msg: Api.Message, command: string): string {
263 const raw = ((msg as any).message || (msg as any).text || "") as string;
264 const prefix = getPrefixes().find((p) => raw.startsWith(p)) || raw[0] || "";
265 const rest = raw.slice(prefix.length).trimStart();
266 if (!rest) return "";
267 const first = rest.split(/\s+/, 1)[0] || "";
268 const normalized = first.replace(/@\w+$/i, "");
269 if (normalized.toLowerCase() !== command.toLowerCase()) return rest;
270 return rest.slice(first.length).trimStart();
271}

Callers 1

handleQuoteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected