Canned responses randomly not working (Discourse 2.2)

I am not sure what caused the issue here, but I refactored that code anyway to something that should work better (is also used in topic map).:slightly_smiling_face:

https://github.com/discourse/discourse-canned-replies/commit/d1c67b23bbef908fb82d5302d2c6f954b8d08187