   end
 
   def set_command(msg, [host]) do
-    set_command(msg, [host, "25_565"])
+    set_command(msg, [host, "25565"])
   end
 
   def set_command(msg, [host, port]) do
     # TODO: validate user input
-
     _check_set_perms(msg)
     {int_port, ""} = Integer.parse(port)
 
+    guild_id =
+      case msg.guild_id do
+        nil -> "dm"
+        _ -> msg.guild_id
+      end
+
     Redix.command!(:redix, [
       "HSET",
-      msg.guild_id,
+      guild_id,
       msg.channel_id,
       Jason.encode!(%{"host" => host, "port" => int_port})
     ])

      end
      |> Enum.join("\n")

    Api.create_message!(msg.channel_id, statuses)
  end

  @doc """

  end

  def _check_set_perms(msg) do
    case msg.guild_id do
      nil ->
        :noop

      _ ->
        guild = Nostrum.Cache.GuildCache.get!(msg.guild_id)
        member = Map.get(guild.members, msg.author.id)

        perms =
          Nostrum.Struct.Guild.Member.guild_channel_permissions(member, guild, msg.channel_id)

        if Enum.all?(
             [:administrator, :manage_channels, :manage_guild, :manage_roles],
             &(&1 not in perms)
           ) do
          mario_roles =
            guild.roles
            |> Enum.filter(fn {_id, %{name: name}} -> name == "mario" end)
            |> Enum.map(fn {id, _role} -> id end)

          if Enum.all?(member.roles, &(&1 not in mario_roles)) do
            raise ProtocolError, message: "You do not have permission to use this command."
          end
        end
    end
  end

