@Sorasyn I noticed your if statements are empty.
its empty becauz if someone join the channel ( your channel )
it will not send $chan : $nick has joined $chan
but in other channels it will send to your channel that that person just join with the name of the channel he join
and like i said
its a simple and short
and also easy so other ppl can learn some things from it :)