title: Expecting top level declaration error on top level declaration
body: <p>I'm new to Kotlin, and, man, it's awesome! </p>
  
  <p>I'm creating a Discord bot with it using JDA &amp; Maven, it works, but, I created a basic command handler, and now, I get a lot of errors saying "Expecting top level declaration" on a top level declaration. </p>
  
  <p>Here is my code (btw, I already found that <code>Array&lt;String?&gt;</code> error):</p>
  
  <pre><code>package com.blueslimee.kirani.listeners
  
  import net.dv8tion.jda.core.entities.*
  import net.dv8tion.jda.core.hooks.*
  import net.dv8tion.jda.core.JDA
  import net.dv8tion.jda.core.events.message.MessageReceivedEvent
  import com.blueslimee.kirani.utils.KiraniLogging
  import com.blueslimee.kirani.KiraniCommand
  import com.blueslimee.kirani.utils.Registry
  
  class MessageListener() : ListenerAdapter() {
    override fun onMessageReceived (event: MessageReceivedEvent) {
      val jda: JDA = event.getJDA()
      // todo: cmds guild-only  event.isFromType(ChannelType.TEXT)
      if (!event.getAuthor().isBot()) {
          var msgContent: String? = event.getMessage()
          if (msgContent === null) {
            return 
          }
          var args: Array&lt;String?&gt; = msgContent!!.split(" ")
          var firstArg: String? = args[0]
          if (!firstArg!!.startsWith("k-", true)) {
            return 
          }
          firstArg = firstArg!!.replace("k-", "", true)
          var cmde: KiraniCommand? = Registry.getCommand(firstArg)
          if (cmde  != null) {
            try {
              cmde!!.run(jda, event, args)
            } catch (e: Exception) {
              event.getChannel().sendMessage("Oopsie Woopsie, um erro ocorreu! Meu dono já foi reportado sobre, peço que aguarde.").queue()
              e.printStackTrace()
            }
         }
      }
    }
  }
  </code></pre>
  
  <p>Thanks!</p>