Do you just want the script to be able to send messages or does it have to be able to execute other commands?

If the former, there's a much easier (and better) way of achieving what you want.