howdyai / botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
MIT License
11.48k stars 2.28k forks source link

Correct interruption and string pattern trigger to Exact String Match #2085

Closed InnoraG closed 3 years ago

InnoraG commented 3 years ago

Very small change in core testTrigger but critical for precise bot dialog :

Problem : const test = new RegExp(trigger.pattern as string, 'i'); is always broad and do not let exact matching control

Solution : const test = new RegExp('^' + trigger.pattern + '$', 'i'); is the correction

Application : As example that change correct Exact String Match functionality of Botkit CMS which is wrongly broad

botkit pull

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.