wingbot 3.68.8 → 3.68.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/BuildRouter.js +1 -1
- package/src/Responder.js +9 -2
package/package.json
CHANGED
package/src/BuildRouter.js
CHANGED
|
@@ -19,7 +19,7 @@ const defaultResourceMap = require('./defaultResourceMap');
|
|
|
19
19
|
const { shouldExecuteResolver } = require('./resolvers/resolverTags');
|
|
20
20
|
|
|
21
21
|
const MESSAGE_RESOLVER_NAME = 'botbuild.message';
|
|
22
|
-
const PLUGIN_RESOLVER_NAME = 'botbuild.
|
|
22
|
+
const PLUGIN_RESOLVER_NAME = 'botbuild.customCode';
|
|
23
23
|
|
|
24
24
|
/** @typedef {import('./Router').BaseConfiguration} BaseConfiguration */
|
|
25
25
|
/**
|
package/src/Responder.js
CHANGED
|
@@ -705,6 +705,7 @@ class Responder {
|
|
|
705
705
|
* @param {QuickReply} reply
|
|
706
706
|
* @param {boolean} [atStart]
|
|
707
707
|
* @param {boolean} [toLastMessage]
|
|
708
|
+
* @param {boolean} [ifNotExists]
|
|
708
709
|
* @returns {this}
|
|
709
710
|
* @example
|
|
710
711
|
*
|
|
@@ -716,12 +717,18 @@ class Responder {
|
|
|
716
717
|
* }); // will be merged and sent with previously added quick replies
|
|
717
718
|
* });
|
|
718
719
|
*/
|
|
719
|
-
quickReply (reply, atStart = false, toLastMessage = true) {
|
|
720
|
+
quickReply (reply, atStart = false, toLastMessage = true, ifNotExists = false) {
|
|
720
721
|
const useCa = this.currentAction();
|
|
721
722
|
|
|
723
|
+
const action = this.toAbsoluteAction(reply.action);
|
|
724
|
+
|
|
725
|
+
if (ifNotExists && !this._quickReplyCollector.some((q) => q.action === action)) {
|
|
726
|
+
return this;
|
|
727
|
+
}
|
|
728
|
+
|
|
722
729
|
this._quickReplyCollector.push({
|
|
723
730
|
...reply,
|
|
724
|
-
action
|
|
731
|
+
action,
|
|
725
732
|
useCa,
|
|
726
733
|
...(atStart && { _prepend: true }),
|
|
727
734
|
...(toLastMessage && { _justToExisting: true })
|