fix: honor telegram pairing allowlists for native commands

This commit is contained in:
Peter Steinberger
2026-01-18 22:50:57 +00:00
parent 0d543dd1ff
commit a7be3a9649
5 changed files with 82 additions and 28 deletions

View File

@@ -24,6 +24,17 @@ export const normalizeAllowFrom = (list?: Array<string | number>): NormalizedAll
};
};
export const normalizeAllowFromWithStore = (params: {
allowFrom?: Array<string | number>;
storeAllowFrom?: string[];
}): NormalizedAllowFrom => {
const combined = [
...(params.allowFrom ?? []),
...(params.storeAllowFrom ?? []),
].map((value) => String(value).trim()).filter(Boolean);
return normalizeAllowFrom(combined);
};
export const firstDefined = <T>(...values: Array<T | undefined>) => {
for (const value of values) {
if (typeof value !== "undefined") return value;