mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 14:37:27 +00:00
telegram: restore sender-only allowFrom validation
This commit is contained in:
@@ -44,12 +44,11 @@ export const normalizeAllowFrom = (list?: Array<string | number>): NormalizedAll
|
||||
const normalized = entries
|
||||
.filter((value) => value !== "*")
|
||||
.map((value) => value.replace(/^(telegram|tg):/i, ""));
|
||||
// Support negative IDs for Telegram group/channel IDs (e.g., -1001234567890)
|
||||
const invalidEntries = normalized.filter((value) => !/^-?\d+$/.test(value));
|
||||
const invalidEntries = normalized.filter((value) => !/^\d+$/.test(value));
|
||||
if (invalidEntries.length > 0) {
|
||||
warnInvalidAllowFromEntries([...new Set(invalidEntries)]);
|
||||
}
|
||||
const ids = normalized.filter((value) => /^-?\d+$/.test(value));
|
||||
const ids = normalized.filter((value) => /^\d+$/.test(value));
|
||||
return {
|
||||
entries: ids,
|
||||
hasWildcard,
|
||||
|
||||
Reference in New Issue
Block a user