You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/extensions/telegram/src/poll-visibility.ts

16 lines
386 B
TypeScript

export function resolveTelegramPollVisibility(params: {
pollAnonymous?: boolean;
pollPublic?: boolean;
}): boolean | undefined {
if (params.pollAnonymous && params.pollPublic) {
throw new Error("pollAnonymous and pollPublic are mutually exclusive");
}
if (params.pollAnonymous) {
return true;
}
if (params.pollPublic) {
return false;
}
return undefined;
}