Refactor message.ts file to fit the requirement in CodeClimate
Created by: windmemory
Refer to PR: https://github.com/Chatie/wechaty/pull/1662#issuecomment-442313225
CodeClimate complains about deep Cognitive Complexity
on mention
function, and several other issues related to this file, need to refactor the code then resolve the issue.
Refer to climate code analysis page