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

#1386: Additional global parameter that can be set to change the typi… #1387

Merged
merged 2 commits into from
Jul 9, 2018

Conversation

schmitzl
Copy link

@schmitzl schmitzl commented Jun 14, 2018

Ticketnummer: #1386

controller.setTypingDelayFactor();

Adjust the speed of the typing delay by setting a factor. The typing delay determines the time that the bot takes, to reply to a message. By default, the factor is set to 1, using a predefined calculation for the typing delay, that takes the message length into account. In order to increase or decrease the typing delay, the factor can be changed. For example, the default typing delay can be doubled by setting the factor to 2.

For example:

// double the time of the typing delay
controller.setTypingDelayFactor(2);

@benbrown
Copy link
Contributor

@schmitzl I think that since this only affects the web adapter, it should be part of that file, not in Core.

I try to avoid putting anything in core that doesn't apply to all platforms.

Can you define the function and variable in Web.js instead?

Also, please add a note about this to the docs page for the web connector that is contained in this other repo

@benbrown benbrown self-requested a review June 27, 2018 21:11
lib/CoreBot.js Outdated
@@ -1438,6 +1439,11 @@ function Botkit(configuration) {
}
};

// change the speed of typing a reply in a conversation
botkit.setTypingDelayFactor = function(delayFactor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define this in lib/Web.js instead

lib/CoreBot.js Outdated
@@ -31,6 +31,7 @@ function Botkit(configuration) {
teams: {},
},
tickDelay: 1500,
typingDelayFactor: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this to the options in web.js ony

@schmitzl
Copy link
Author

@benbrown Thank you for the feedback. I implemented the changes and created a pull request for the docs (howdyai/botkit-docs#9).

@benbrown
Copy link
Contributor

Great, I will re-review! Thanks contributing!

@benbrown
Copy link
Contributor

oops @schmitzl it doesn't look like your new changes have been pushed to this PR yet

@schmitzl
Copy link
Author

@benbrown Sorry, wrong branch! I hope you can view the changes now.

@benbrown benbrown merged commit 42b5fbf into howdyai:master Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants