If you send your own IRC commands (most IRC clients let you easily inject arbitrary commands with /command here
), you have to format it correctly, with a :
before the final parameter if it contains spaces:
TOPIC #abcdereh :My name is Clement
Most IRC clients have an alias for /TOPIC
that does that stuff for you.
If you are writing your own client, make sure that you handle the following cases:
/TOPIC
: sendTOPIC #currentchannel
/TOPIC #somechannel
sendTOPIC #somechannel
/TOPIC Not a channel
sendTOPIC #currentchannel :Not a channel
/TOPIC #somechannel New Topic
sendTOPIC #somechannel :New Topic