refactor: remove redundant telegram conversions

This commit is contained in:
Peter Steinberger
2026-04-10 21:49:54 +01:00
parent 405a920862
commit 506f564fb9
3 changed files with 5 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ export function collectTelegramUnmentionedGroupIds(
};
}
const hasWildcardUnmentionedGroups =
Boolean(groups["*"]?.requireMention === false) && groups["*"]?.enabled !== false;
groups["*"]?.requireMention === false && groups["*"]?.enabled !== false;
const groupIds: string[] = [];
let unresolvedGroups = 0;
for (const [key, value] of Object.entries(groups)) {
@@ -37,7 +37,7 @@ export function collectTelegramUnmentionedGroupIds(
if (value.requireMention !== false) {
continue;
}
const id = normalizeOptionalString(String(key)) ?? "";
const id = normalizeOptionalString(key) ?? "";
if (!id) {
continue;
}

View File

@@ -45,7 +45,7 @@ export function resolveTelegramCustomCommands(params: {
for (let index = 0; index < entries.length; index += 1) {
const entry = entries[index];
const normalized = normalizeTelegramCommandName(String(entry?.command ?? ""));
const normalized = normalizeTelegramCommandName(entry?.command ?? "");
if (!normalized) {
issues.push({
index,
@@ -78,7 +78,7 @@ export function resolveTelegramCustomCommands(params: {
});
continue;
}
const description = normalizeTelegramCommandDescription(String(entry?.description ?? ""));
const description = normalizeTelegramCommandDescription(entry?.description ?? "");
if (!description) {
issues.push({
index,

View File

@@ -54,7 +54,7 @@ export async function collectTelegramSecurityAuditFindings(params: {
() => [],
);
const storeHasWildcard = storeAllowFrom.some(
(value) => (normalizeOptionalString(String(value)) ?? "") === "*",
(value) => (normalizeOptionalString(value) ?? "") === "*",
);
const invalidTelegramAllowFromEntries = new Set<string>();
collectInvalidTelegramAllowFromEntries({