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

First message not processed when chat is not approved #42

Closed
dcts opened this issue Jan 12, 2021 · 1 comment
Closed

First message not processed when chat is not approved #42

dcts opened this issue Jan 12, 2021 · 1 comment

Comments

@dcts
Copy link
Contributor

dcts commented Jan 12, 2021

When a new user DM's the bot for the first time, the message usually gets added to pendingRequests. When you try to approve the chat directly and message back instantly, there is an error. Approving the new user works fine, however the message will not be emitted and throw an error.

Example of breaking code:

client.on('pendingRequest', (chat) => {
  chat.approve();
});

I fixed this issue with this pull request. Leaving here in case someone has the same issue.

@dcts dcts changed the title First message not processed when chat is not apprived First message not processed when chat is not approved Jan 12, 2021
@dcts
Copy link
Contributor Author

dcts commented Jan 23, 2021

fixed with pull request #41

@dcts dcts closed this as completed Jan 23, 2021
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

No branches or pull requests

1 participant