mirror of https://github.com/openclaw/openclaw.git
12 lines
338 B
TypeScript
12 lines
338 B
TypeScript
export function normalizeTelegramAllowFromEntry(raw: unknown): string {
|
|
const base = typeof raw === "string" ? raw : typeof raw === "number" ? String(raw) : "";
|
|
return base
|
|
.trim()
|
|
.replace(/^(telegram|tg):/i, "")
|
|
.trim();
|
|
}
|
|
|
|
export function isNumericTelegramUserId(raw: string): boolean {
|
|
return /^-?\d+$/.test(raw);
|
|
}
|