mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
Merge pull request #923 from Hexastack/906-bug---incorrect-chatbot-response-sequencing
fix(api): resolve messages order response
This commit is contained in:
commit
8ced75ef53
@ -88,7 +88,7 @@ export class BotService {
|
||||
read: false,
|
||||
delivery: false,
|
||||
};
|
||||
this.eventEmitter.emit('hook:chatbot:sent', sentMessage, event);
|
||||
await this.eventEmitter.emitAsync('hook:chatbot:sent', sentMessage, event);
|
||||
|
||||
// analytics log block or local fallback
|
||||
if (fallback) {
|
||||
@ -425,7 +425,12 @@ export class BotService {
|
||||
subscriber.id,
|
||||
block.name,
|
||||
);
|
||||
return this.triggerBlock(event, updatedConversation, block, false);
|
||||
return await this.triggerBlock(
|
||||
event,
|
||||
updatedConversation,
|
||||
block,
|
||||
false,
|
||||
);
|
||||
} catch (err) {
|
||||
this.logger.error('Unable to store context data!', err);
|
||||
this.eventEmitter.emit('hook:conversation:end', convo);
|
||||
|
@ -96,7 +96,7 @@ export class ChatService {
|
||||
*
|
||||
* @param sentMessage - The message that has been sent
|
||||
*/
|
||||
@OnEvent('hook:chatbot:sent')
|
||||
@OnEvent('hook:chatbot:sent', { promisify: true })
|
||||
async handleSentMessage(
|
||||
sentMessage: MessageCreateDto,
|
||||
_event: EventWrapper<any, any>,
|
||||
|
Loading…
Reference in New Issue
Block a user