on input event only works if you are typing and pressing enter

is their a way to make it work when other scripts are doing /msg to a channel?