Updated setTimeout
Some checks are pending
Main / build-and-push-docker-image (20.x) (pull_request) Waiting to run

This commit is contained in:
2025-10-21 00:38:18 -04:00
parent 1b38aad76a
commit 8021a9561e

View File

@@ -64,6 +64,21 @@ async function startWebhook(config: WebhookConfig) {
// to prevent receiving updates before the bot is ready
await bot.init();
const setWebhook = async (): Promise<void> => {
// set webhook
return await bot.api
.setWebhook(config.botWebhook, {
allowed_updates: config.botAllowedUpdates,
secret_token: config.botWebhookSecret
})
.then(() => {
logger.info({
msg: "Webhook was set",
url: config.botWebhook
});
});
};
// start server
const info = await serverManager.start().then(async info => {
logger.info({
@@ -72,19 +87,8 @@ async function startWebhook(config: WebhookConfig) {
});
setTimeout(async () => {
// set webhook
await bot.api
.setWebhook(config.botWebhook, {
allowed_updates: config.botAllowedUpdates,
secret_token: config.botWebhookSecret
})
.then(() => {
logger.info({
msg: "Webhook was set",
url: config.botWebhook
});
});
}, 60000);
await setWebhook();
}, 10000);
});
}