This PQ interdicts this type of usage and throws a helpful error message.
If this is actually desired (run the bot on built-in polling but then also supply old updates from a webhook queue, whatever) then it can be done anyway:
const middleware = new Composer()
middleware.use(..) // etc
const pollingBot = new Bot(token)
const webhookBot = new Bot(token)
pollingBot.use(middleware)
webhookBot.use(middleware)
pollingBot.start()
webhookCallback(webhookBot)
People sometimes do
or
and in 99 % of cases, this is just wrong.
This PQ interdicts this type of usage and throws a helpful error message.
If this is actually desired (run the bot on built-in polling but then also supply old updates from a webhook queue, whatever) then it can be done anyway: