use
/help ctcp
to list the command but here is a code snipplet

Code:
ctcp 1:version:?:{ ctcpreply $nick VERSION this is my version }


Lets get dirty