Reply with promises
See original GitHub issueHi everyone, within 2 months I used all replies and other interactivity commands with promises and everything was fine. But today I created new project with the last update and encountered with a problem:
bot.start((ctx) => {
authReq(ctx)
.then(response => {
mockup.reply(ctx, 'Success!');
mockup.reply(ctx, 'Success!');
console.log(response)
})
.catch(err => {
mockup.reply(ctx, answers.error);
mockup.toAllAdmins(ctx, 'Start', err);
console.log(err)
})
});
where authReq returns Promise, and mockup.reply does a bit the sam as ctx.reply and what is a problem… If I delete one of mockup.reply(ctx, ‘Success!’); user recieve nothing and when I double reply function user recieve Success one time (console.log(response) works). In addition, if there will be an err mockup.reply works with and without toAllAdmins function o_O Is there anything changed in the new update or my code is wrong, pls help…
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top Results From Across the Web
reply to new on promises - by pall s. ardal - JSTOR
REPLY TO NEW ON PROMISES. BY PALL S. ARDAL. Mr. C. G. New argues (this journal, April 1969) that I maintain that. (A)...
Read more >What is to say, when you ask your friend to promise ... - Quora
With respect, this is the wrong question. The correct questions are: "Am I worthy of trust? And, “Is he/she? Furthermore, the 2 answers...
Read more >Error handling with promises
Asynchronous actions may sometimes fail: in case of an error the corresponding promise becomes rejected. For instance, fetch fails if the remote server...
Read more >Replies as Promises · Issue #1557 · nock/nock - GitHub
Context Writing jest mocks for a got client (eg. got.extend()), was looking into dynamically loaded fixtures as replies.
Read more >Creflo Dollar — How to Respond to the Promise?
We've talked about that, you know, we apprehend and appropriate these things by faith, and thank God for all that. I wanna give...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tva10 @JRakhimov Guys, in provided example I found that you break the promise chain. To fix that, just add
return
keywords:Related issue