INNER CODE UNIT · TypeScript

validateAllowedUpdates

grammyjs/grammY · src/bot.ts:736

function validateAllowedUpdates(
    updates: Set<string>,
    allowed: readonly string[] = DEFAULT_UPDATE_TYPES,
) {
    const impossible = Array.from(updates).filter((u) => !allowed.includes(u));
    if (impossible.length > 0) {
        debugWarn(
            `You registered listeners for the following update types, \
but you did not specify them in \`allowed_updates\` \
so they may not be received: ${impossible.map((u) => `'${u}'`).join(", ")}`,
        );
    }
}
function noUseFunction(): never {
    throw new Error(`It looks like you are registering more listeners \
on your bot from within other listeners! This means that every time your bot \
handles a message like this one, new listeners will be added. This list grows until \
your machine crashes, so grammY throws this error to tell you that you should \

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…