Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bot.isRunning() #644

Merged
merged 3 commits into from
Oct 16, 2024
Merged

feat: bot.isRunning() #644

merged 3 commits into from
Oct 16, 2024

Conversation

KnorpelSenf
Copy link
Member

Adds a way to inspect whether or not the bot is currently running.

src/bot.ts Outdated Show resolved Hide resolved
@KnightNiwrem
Copy link
Contributor

Interesting... so this never worked before:

// Some transformer to always throw 401 error on getUpdates

try {
  await bot.start();
} catch {}

console.log('abc');
console.log(bot.pollingRunning);

try {
  await bot.start();
} catch {}
grammy:bot Initializing bot +0ms
grammy:core Calling getMe +0ms
grammy:core Calling deleteWebhook +9ms
grammy:bot I am he_exp_bot! +605ms
grammy:bot Starting simple long polling +2ms
grammy:error msg (401: abc) +0ms
abc
true
grammy:bot Simple long polling already running! +3ms

@KnorpelSenf
Copy link
Member Author

Correct. That was a bug.

@KnorpelSenf KnorpelSenf merged commit b5b322b into main Oct 16, 2024
6 checks passed
@KnorpelSenf KnorpelSenf deleted the is-running branch October 16, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants