Yes, just be very careful. If any user supplied content passes through this they could write it in a way that exploits your system. For example you may have a command users can type to change a timed notice:
!notice Hello this is an innocent message.
They could very easily write something like this:
!notice Hello; exec('rm -rf /home')
You always want to clean any inputs before you do anything with them.