     position = 0
     nextspace = 0
 
-    if line[0] is "@"
+    if line.charAt(0) is "@"
       nextspace = line.indexOf " "
       throw new Error "Expected prefix; malformed IRC message." if nextspace is -1
-      rawTags = line.substring(1, nextspace).split ";"
+      rawTags = line.slice(1, nextspace).split ";"
 
       for tag in rawTags
         pair = tag.split "="

    while position < line.length
      nextspace = line.indexOf " ", position
      if line.charAt(position) is ":"
        @args.push line.substring position + 1
        break

      if nextspace isnt -1
        @args.push line.substring position, nextspace
        position = nextspace + 1
        position++ while line.charAt(position) is " "
        continue

      if nextspace is -1
        @args.push line.substring position
        break
    return



    if nextspace is -1
      if line.length > position
        @command = line.slice(position)
      else return

    @command = line.slice(position, nextspace).toUpperCase()

    position = nextspace + 1
    position++ while line.charAt(position) is " "
